...
For any given source file named src/foo/MyClass.cpp
, place unittests in a file named src/test/foo/MyClassTest.cpp
.
Use the source file TestTemplate.cpp as a template for creating all new unittests. (hint: Copy TestTemplate.cpp
to a new file called MyClassTest.cpp
then search and replace TestTemplate
with MyClassTest
.)
...
If any one unittest fails, it will stop the build from succeeding. In scenarios where you want to check in a failed unittest to communicate a bug beyond your control to fix, you can use the macros KNOWN_BUG
and KNOWN_FATAL_BUG
to signify such issues. This will not break the build, but will report errors to stdout. See TestUtilities.h header file for more information.
...