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

后端 未结 2 390
北海茫月
北海茫月 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条回答
  •  自闭症患者
    2020-12-09 12:40

    In CMake 3.17 release notes, there's a new variable CMAKE_CTEST_ARGUMENTS that you can set to pass any command-line arguments to CTest, including --output-on-failure. In your specific case, you can now simply add this to your CMakeLists.txt:

    list(APPEND CMAKE_CTEST_ARGUMENTS "--output-on-failure")
    

提交回复
热议问题