Skip to content

Commit 036f19f

Browse files
committed
Add CTest output on failure
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.
1 parent f026cab commit 036f19f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ endif()
119119
set(DART_TESTING_TIMEOUT 240 CACHE STRING "Maximum time allowed before CTest will kill the test.")
120120
include(CTest)
121121
if(BUILD_TESTING)
122+
list(APPEND CMAKE_CTEST_ARGUMENTS "--output-on-failure")
122123
enable_testing()
123124
add_subdirectory(test_suite)
124125
if(MSVC_IDE)

0 commit comments

Comments
 (0)