CTest: does not write JUnit XML file when tests fail
When running ctest
with --output-junit
option, the XML report is produced when all tests succeed but if at least one fails, then ctest
fails with 8
error code as expected (TEST_ERRORS
), but then, no XML file is produced.
I looked into the code and couldn't figure why. Just overwriting the return code of the main
function with 0
in ctest.cxx
seems to "work", so I do not understand what operation after that return prevents the file to be written.
Tested with the version from Pip (3.22.3), the latest release version (3.23.1) and from master
sources (3.23.20220413-g56dafdf1).
Edited by Lélio Brun