summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2022-10-18 18:16:10 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2022-10-18 20:52:23 (GMT)
commitbea4ed543058ef36503503cda2adf669c09671f5 (patch)
tree68ec063132ed1c9eaf06d8e85035204700860583 /Source/cmCTest.cxx
parent9270a02003a86cdb5025252f61a8baf4a40e2ddc (diff)
downloadCMake-bea4ed543058ef36503503cda2adf669c09671f5.zip
CMake-bea4ed543058ef36503503cda2adf669c09671f5.tar.gz
CMake-bea4ed543058ef36503503cda2adf669c09671f5.tar.bz2
CTest: Add support for outputJUnitFile in presets
Fixes: #22400
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx18
1 files changed, 13 insertions, 5 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 66507a7..f60a1e9 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -2116,11 +2116,7 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
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;
+ this->SetOutputJUnitFileName(std::string(args[i]));
}
cm::string_view noTestsPrefix = "--no-tests=";
@@ -2458,6 +2454,9 @@ bool cmCTest::SetArgsFromPreset(const std::string& presetName,
if (!expandedPreset->Output->OutputLogFile.empty()) {
this->SetOutputLogFileName(expandedPreset->Output->OutputLogFile);
}
+ if (!expandedPreset->Output->OutputJUnitFile.empty()) {
+ this->SetOutputJUnitFileName(expandedPreset->Output->OutputJUnitFile);
+ }
this->Impl->LabelSummary =
expandedPreset->Output->LabelSummary.value_or(true);
@@ -3541,6 +3540,15 @@ void cmCTest::SetOutputLogFileName(const std::string& name)
}
}
+void cmCTest::SetOutputJUnitFileName(const std::string& name)
+{
+ this->Impl->TestHandler.SetJUnitXMLFileName(name);
+ // Turn test output compression off.
+ // This makes it easier to include test output in the resulting
+ // JUnit XML report.
+ this->Impl->CompressTestOutput = false;
+}
+
static const char* cmCTestStringLogType[] = { "DEBUG",
"OUTPUT",
"HANDLER_OUTPUT",