diff options
author | Zack Galbreath <zack.galbreath@kitware.com> | 2021-04-22 23:38:43 (GMT) |
---|---|---|
committer | Zack Galbreath <zack.galbreath@kitware.com> | 2021-04-26 12:55:22 (GMT) |
commit | 25bf514447501963a31934b5b03c65aeb53a351f (patch) | |
tree | 9a8392707d6376d588da56100a9ab214abd2ef43 /Source/cmCTest.cxx | |
parent | eeb771e4d6b9a1127a0818a211cafb722a2dc387 (diff) | |
download | CMake-25bf514447501963a31934b5b03c65aeb53a351f.zip CMake-25bf514447501963a31934b5b03c65aeb53a351f.tar.gz CMake-25bf514447501963a31934b5b03c65aeb53a351f.tar.bz2 |
ctest: Add support for writing test results in JUnit XML format
Addresses #18654
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r-- | Source/cmCTest.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 643b43f..79a3925 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2069,6 +2069,17 @@ bool cmCTest::HandleCommandLineArguments(size_t& i, } i++; this->Impl->TestDir = std::string(args[i]); + } else if (this->CheckArgument(arg, "--output-junit"_s)) { + if (i >= args.size() - 1) { + errormsg = "'--output-junit' requires an argument"; + return false; + } + i++; + this->Impl->TestHandler.SetJUnitXMLFileName(std::string(args[i])); + // Turn test output compression off. + // This makes it easier to include test output in the resulting + // JUnit XML report. + this->Impl->CompressTestOutput = false; } cm::string_view noTestsPrefix = "--no-tests="; |