Please add to README how to run tests
yurivict opened this issue · 6 comments
yurivict commented
Usually it should be sufficient to:
cmake -DBUILD_TESTS=ON
make test
rollbear commented
It suffices to make as a top level project and -DCMAKE_BUILD_TYPE=Debug
, but you're right, it's missing in the README. I'll add it.
yurivict commented
But this isn't right. Debug is a different build type. Sometimes debug code works and release code doesn't work.
The Release code should be tested as it is normally built.
rollbear commented
I stated how it works, not how it ought to work.
yurivict commented
Tests don't get built with CMAKE_BUILD_TYPE=Debug
either for me.
rollbear commented
Hmm. Interesting.
bf@pteranodon /tmp> cmake -B build -DCMAKE_BUILD_TYPE=Debug ~/devel/trompeloeil
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test WARN_NONNULL
-- Performing Test WARN_NONNULL - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/build
bf@pteranodon /tmp> cmake --build build -t self_test thread_terror custom_recursive_mutex
Scanning dependencies of target self_test
[ 25%] Building CXX object CMakeFiles/self_test.dir/test/compiling_tests.cpp.o
[ 50%] Building CXX object CMakeFiles/self_test.dir/test/compiling_tests_11.cpp.o
[ 75%] Building CXX object CMakeFiles/self_test.dir/test/compiling_tests_14.cpp.o
[100%] Linking CXX executable self_test
[100%] Built target self_test
Scanning dependencies of target thread_terror
[ 50%] Building CXX object CMakeFiles/thread_terror.dir/test/thread_terror.cpp.o
[100%] Linking CXX executable thread_terror
[100%] Built target thread_terror
Scanning dependencies of target custom_recursive_mutex
[ 50%] Building CXX object CMakeFiles/custom_recursive_mutex.dir/test/custom_recursive_mutex.cpp.o
[100%] Linking CXX executable custom_recursive_mutex
[100%] Built target custom_recursive_mutex
bf@pteranodon /tmp> ./build/self_test && ./build/thread_terror && ./build/custom_recursive_mutex
===============================================================================
All tests passed (830 assertions in 521 test cases)
calls 263345 56363 49031 59207 53873 58819 59362
returns 263345 56363 49031 59207 53873 58819 59362
bf@pteranodon /tmp>
What failure are you seeing?
rollbear commented
It is added to the README now. Let me know if the description needs to be updated.