0

Is there any way to make Boost.Test take the name of the file as automatic test suite name, in a portable manner?

Something like BOOST_AUTO_TEST_SUITE(__FILE__) (this doesn't work because __FILE__ contains full path and is not a string object).

Thanks!

Alex Jenter
  • 4,324
  • 4
  • 36
  • 61
  • It looks to me like an anti-pattern for testing. Why do you think this is a convenient thing to do? – Raffi Feb 14 '18 at 18:40
  • Just following the "don't repeat yourself" principle. I have already named the test suite when I named the file. I shouldn't have to repeat this name in macro invocation. – Alex Jenter Feb 16 '18 at 09:53
  • But if for the sake of the "don't repeat yourself" principle, everything becomes hard to maintain, error prone, not cross platform, etc, what is the point? – Raffi Mar 28 '18 at 14:03
  • "There's currently no way to do it in a portable and easy to maintain manner" is a valid answer to my question. – Alex Jenter Mar 29 '18 at 09:17

0 Answers0