How do I get "make test" to display verbose output? I want "make test" to do the same thing as ctest -V through the command line.
I have tried adding the following to my CMakeLists.txt, nothing worked :(
set(ENV{CTEST_OUTPUT_ON_FAILURE} TRUE)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --verbose)
add_custom_command(TARGET test PRE_BUILD
COMMAND ${CMAKE_CTEST_COMMAND} -V)
But I still get this when I run make test:
Start 1: unittest1
1/143 Test #1: unittest1 .................................... Passed 0.01 sec
Start 2: unittest2
2/143 Test #2: unittest2 ............................ Passed 0.03 sec
Start 3: unittest3
3/143 Test #3: unittest3 .................... Passed 0.02 sec
To clarify, I want to add something to my CMakeLists.txt to make this possible, I don't want a manual solution that requires me to append something to "make test" in the command line such as
CTEST_OUTPUT_ON_FAILURE=TRUE make test
or
ctest -V
My question is similar to Using cmake how do I get verbose output from ctest?.