Replace ctest command with “ctest --output-on-failure” permanently for a specific project in CMakeLists.txt

后端 未结 2 393
北海茫月
北海茫月 2020-12-09 12:13

I have found that generic ctest command doesn\'t give much information about the tests, so I would like to add ctest --output-on-failure but not ha

2条回答
  •  萌比男神i
    2020-12-09 12:31

    I went with make check per solution: CMake: setting an environmental variable for ctest (or otherwise getting failed test output from ctest/make test automatically)

    add_custom_target(check ${CMAKE_COMMAND} -E env CTEST_OUTPUT_ON_FAILURE=1
                      ${CMAKE_CTEST_COMMAND} -C $ --verbose
                      WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
    

提交回复
热议问题