Automated Tests - Brewken/brewken GitHub Wiki

When you build the software with make, it actually builds two versions of the binary, both of which get dumped in the src subdirectory of the the build directory (thus typically build/src) which NB is not the same as the main src directory. (We should probably rename build/src to build/generated_src or something to avoid confusion.) One version of the binary (brewken) is what will get packaged or installed to run the actual program. The other (Brewken_tests) also contains the unit testing code.

When you do make test, the tests defined in src/Testing.cpp get executed (or at least those tests that were set to be run via an ADD_TEST in src/CMakeLists.txt). The output from the tests ends up in a different subdirectory of build, build/Testing/Temporary. But if testing generates a core file, it will be in build/src.

If you're trying to debug the code in Testing.cpp via make test, be aware you need to look in different places for logging output. Stdout and stderr will be in build/Testing/Temporary/LastTest.log or build/Testing/Temporary/LastTest.log.tmp (though they will seem to be shown on the console in a GitHub build), but almost no Qt logging will go to stderr. The Qt log files will also be in a temporary directory (eg /tmp on Linux). However, you can make life simpler by running an individual test directly from the command line without CMake wrapper, eg, if you are in the build directory:

./src/Brewken_tests "pstdintTest"