I've read
which is closed as too broad; and answer-wise, while it lists several testing frameworks it doesn't really compare them or discuss their features.
Now, I'm interested in adding a framework for unit tests for an existing project of mine. It actually already includes a binary which performs a certain kind of unit tests, or perhaps I should something between unit and subsystem tests - but its' not a unit testing framework in itself and not intended to test all of the code. Which is why I want a proper framework. It may (or may not) also allow me to drop some of the custom code I have right now.
A significant requirement that I have is that the framework be Modern-C++-oriented. That is, that the syntax for using it will be C++11'ish (could be C++14 or C++17, but the latter option might give me some trouble due to CUDA compatibility issues), rather than just supporting the testing of C++11 code as an afterthought. So when I read, for example, that Google Test only needs a C++98 compiler, I get worried.
Other key features (partly adapted from this article):
- Minimal amount of work needed to add new tests.
- Easy to modify and port - but not for the reasons mentioned here! That is, it can and should depend on advanced C++ language and standard library features, as long as they're standard; and I don't mind dependencies on something like, say, CMake, or some scripting language etc, as long as it's tolerant to the difference between OSes and OS distributions.
- Supports setup/teardown steps (fixtures).
- Flexible and robust w.r.t. exceptions, crashes and asserts.
- Nice pretty-printed/ASCII-graphics-enhanced console output. I don't care for any specific such features, e.g. colors vs monochrome or whether or not progress and succeses/failures are animated, but it should be pleasingly readable.
- Integration with IDEs is a big plus
and of course:
- Free and Open Source license
- Gratis
- Support for different output formats, for use by various post-mortem tools
I would really like a comparison of strengths and weaknesses w.r.t. the features I listed as well as a comparison on a single framework.