Skip to content

Commit

Permalink
Add CTest output on failure
Browse files Browse the repository at this point in the history
When running the test suite through CMake (by building RUN_TESTS are
make test), you don't get to see the output of the tests. You just see
something like this:

       Start  1: test_io_arg_parser
  1/82 Test  #1: test_io_arg_parser ................. Passed  0.00 sec
       Start  2: test_io_binary_stream
  2/82 Test  #2: test_io_binary_stream ........... ***Failed  0.00 sec
       Start  3: test_io_file_attributes
  3/82 Test  #3: test_io_file_attributes ............ Passed  0.01 sec

This makes it hard to debug failing unittests on CI builds, where it's
hard to get to the output log files, or to rerun unittests manually.

This flag will print the output of failing tests, for easier debugging.
  • Loading branch information
bdegreve committed May 12, 2024
1 parent f026cab commit 036f19f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ endif()
set(DART_TESTING_TIMEOUT 240 CACHE STRING "Maximum time allowed before CTest will kill the test.")
include(CTest)
if(BUILD_TESTING)
list(APPEND CMAKE_CTEST_ARGUMENTS "--output-on-failure")
enable_testing()
add_subdirectory(test_suite)
if(MSVC_IDE)
Expand Down

0 comments on commit 036f19f

Please sign in to comment.