CMakePresets.json: Add outputJUnitFile to test presets schema
This commit is contained in:
parent
757786bb73
commit
9270a02003
@ -265,6 +265,8 @@ bool ExpandMacros(const cmCMakePresetsGraph& graph, const TestPreset& preset,
|
||||
if (out->Output) {
|
||||
CHECK_EXPAND(out, out->Output->OutputLogFile, macroExpanders,
|
||||
graph.GetVersion(preset));
|
||||
CHECK_EXPAND(out, out->Output->OutputJUnitFile, macroExpanders,
|
||||
graph.GetVersion(preset));
|
||||
}
|
||||
|
||||
if (out->Filter) {
|
||||
@ -851,6 +853,7 @@ cmCMakePresetsGraph::TestPreset::VisitPresetInherit(
|
||||
parentOutput.OutputOnFailure);
|
||||
InheritOptionalValue(output.Quiet, parentOutput.Quiet);
|
||||
InheritString(output.OutputLogFile, parentOutput.OutputLogFile);
|
||||
InheritString(output.OutputJUnitFile, parentOutput.OutputJUnitFile);
|
||||
InheritOptionalValue(output.LabelSummary, parentOutput.LabelSummary);
|
||||
InheritOptionalValue(output.SubprojectSummary,
|
||||
parentOutput.SubprojectSummary);
|
||||
@ -1253,6 +1256,8 @@ const char* cmCMakePresetsGraph::ResultToString(ReadFileResult result)
|
||||
return "Invalid workflow steps";
|
||||
case ReadFileResult::WORKFLOW_STEP_UNREACHABLE_FROM_FILE:
|
||||
return "Workflow step is unreachable from preset's file";
|
||||
case ReadFileResult::CTEST_JUNIT_UNSUPPORTED:
|
||||
return "File version must be 6 or higher for CTest JUnit output support";
|
||||
}
|
||||
|
||||
return "Unknown error";
|
||||
|
@ -54,6 +54,7 @@ public:
|
||||
TEST_OUTPUT_TRUNCATION_UNSUPPORTED,
|
||||
INVALID_WORKFLOW_STEPS,
|
||||
WORKFLOW_STEP_UNREACHABLE_FROM_FILE,
|
||||
CTEST_JUNIT_UNSUPPORTED,
|
||||
};
|
||||
|
||||
std::string errors;
|
||||
@ -230,6 +231,7 @@ public:
|
||||
cm::optional<bool> OutputOnFailure;
|
||||
cm::optional<bool> Quiet;
|
||||
std::string OutputLogFile;
|
||||
std::string OutputJUnitFile;
|
||||
cm::optional<bool> LabelSummary;
|
||||
cm::optional<bool> SubprojectSummary;
|
||||
cm::optional<int> MaxPassedTestOutputSize;
|
||||
|
@ -588,6 +588,11 @@ cmCMakePresetsGraph::ReadFileResult cmCMakePresetsGraph::ReadJSONFile(
|
||||
return ReadFileResult::TEST_OUTPUT_TRUNCATION_UNSUPPORTED;
|
||||
}
|
||||
|
||||
// Support for outputJUnitFile added in version 6.
|
||||
if (v < 6 && preset.Output && !preset.Output->OutputJUnitFile.empty()) {
|
||||
return ReadFileResult::CTEST_JUNIT_UNSUPPORTED;
|
||||
}
|
||||
|
||||
this->TestPresetOrder.push_back(preset.Name);
|
||||
}
|
||||
|
||||
|
@ -104,6 +104,8 @@ auto const TestPresetOptionalOutputHelper =
|
||||
cmCMakePresetsGraphInternal::PresetOptionalBoolHelper, false)
|
||||
.Bind("outputLogFile"_s, &TestPreset::OutputOptions::OutputLogFile,
|
||||
cmCMakePresetsGraphInternal::PresetStringHelper, false)
|
||||
.Bind("outputJUnitFile"_s, &TestPreset::OutputOptions::OutputJUnitFile,
|
||||
cmCMakePresetsGraphInternal::PresetStringHelper, false)
|
||||
.Bind("labelSummary"_s, &TestPreset::OutputOptions::LabelSummary,
|
||||
cmCMakePresetsGraphInternal::PresetOptionalBoolHelper, false)
|
||||
.Bind("subprojectSummary"_s,
|
||||
|
Loading…
Reference in New Issue
Block a user