Search code examples
c++unit-testing

Non macro based unit test frameworks


Bjarne Stroustrup said in a video on CppCon that, one of his desires for the future of the language is to remove the preprocessor ecosystem from the standard.

I am looking for a unit test that is design is not macro based, but I am unable to found anything decent.

Does anyone knows about one?


Solution

  • No decent ones currently exist, because there are still some things that are impossible to do in C++ without macros (e.g. getting a stringified version of an assert expression). Before we can remove our usage of macros, the C++ language needs to evolve. Check back in 10 years.

    In the meantime, I recommend Catch2.