summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
authorZack Galbreath <zack.galbreath@kitware.com>2021-04-22 23:38:43 (GMT)
committerZack Galbreath <zack.galbreath@kitware.com>2021-04-26 12:55:22 (GMT)
commit25bf514447501963a31934b5b03c65aeb53a351f (patch)
tree9a8392707d6376d588da56100a9ab214abd2ef43 /Source/cmCTest.cxx
parenteeb771e4d6b9a1127a0818a211cafb722a2dc387 (diff)
downloadCMake-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.cxx11
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=";