Hey there,
Summary:
CTest outputs one unified log file when running “-O output.log”.
I would love to see an option where you could generate a log file per CTest test into a log directory.
It would be particularly helpful to generate log files for only failing tests.
This would keep the test report clear and concise, but enable debugging.
Behaviour:
Turned on via a command line argument.
--log-per-test
Each test output log would go to a log directory, under testname.log
logs/test_name0.log
logs/test_name1.log
logs/test_name2.log
CTest would create a log file for EACH test, i.e. STD OUT or test output redirects to a log file all the time
OR
Create a log for each failing test only
The output report would report the failing tests like so:
The following tests FAILED:
1 - bf16_test0 (Failed)
Log: (<full_path>/logs/bf16_test0.log)
2 - bf16_test1(Failed)
Log: (<full_path>/logs/bf16_test1.log)
Options
Also here’s some options that would be nice to see
- Define log directory:
Gives the user the option to define a log directory, for when logging is.
(A better naming convention I think would work better I think)
--log-per-test-dir logs/custom_dir
or using a CTest CMake environment variable:
set(CTEST_PER_TEST_LOG_DIRECTORY, "<something>")
- Create a log file only for failing tests
Gives the user the option to define a log directory, for when logging is.
--log-on-failure-only
or using a CTest CMake environment variable:
set(CTEST_LOG_PER_TEST_ON_FAILURE_ONLY, "<something>")
This feature would help adoption in my organization. Particularly for CI applications
Thanks.