BЈовић BЈовић - 1 year ago 58
Linux Question

Unit testing framework for C++ that doesn't need to preprocess the code

There are several major unit tests frameworks, but as far as I know all of them needs to process the source code in some way.

For example, I am using cxxunit, and it requires the unit tests to be processed using some python script. The problem with this is that it increases the build time.

Does anyone know of a unit testing framework for C++ code that doesn't preprocess the unit tests code?

PS: I need it for linux, but it is ok if it is multi platform.

Answer Source

You could use google test framework. You need just build library source code one time. Then you can create your tests as .cpp files, then compile and link them with gtest and needed project libraries as ordinary c++ sources.

Besides that, it is multiplatform.