Tests don't check anything in release build
I want to use the Simple-Web-Server. In order to do so I have to build and run all tests. If I build tests in Release mode, they don't check anything, because assert marco from is disabled when NDEBUG is defined:
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
CMAKE_BUILD_TYPE=Release
implies -NDEBUG
for some compilers (see related Stackoverflow discussion).
Steps to reproduce:
-
change any condition for any assertion in tests;
-
build and run tests in release mode:
mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release .. cmake --build . ctest
Actual behaviour: tests pass.
Expected behavior: tests fail.