mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
cmCMakePresetsGraph: do not set default value for TestOutputTruncation
The `TestOutputTruncation` is an optional preset. Do not set a default value to avoid failing the JSON schema version check. Closes issue #23411.
This commit is contained in:
@@ -569,7 +569,7 @@ cmCMakePresetsGraph::ReadFileResult cmCMakePresetsGraph::ReadJSONFile(
|
||||
}
|
||||
|
||||
// Support for TestOutputTruncation added in version 5.
|
||||
if (v < 5 && preset.Output) {
|
||||
if (v < 5 && preset.Output && preset.Output->TestOutputTruncation) {
|
||||
return ReadFileResult::TEST_OUTPUT_TRUNCATION_UNSUPPORTED;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,10 +58,10 @@ auto const TestPresetOptionalOutputVerbosityHelper =
|
||||
TestPresetOutputVerbosityHelper);
|
||||
|
||||
ReadFileResult TestPresetOutputTruncationHelper(
|
||||
cmCTestTypes::TruncationMode& out, const Json::Value* value)
|
||||
cm::optional<cmCTestTypes::TruncationMode>& out, const Json::Value* value)
|
||||
{
|
||||
if (!value) {
|
||||
out = cmCTestTypes::TruncationMode::Tail;
|
||||
out = cm::nullopt;
|
||||
return ReadFileResult::READ_OK;
|
||||
}
|
||||
|
||||
@@ -87,10 +87,6 @@ ReadFileResult TestPresetOutputTruncationHelper(
|
||||
return ReadFileResult::INVALID_PRESET;
|
||||
}
|
||||
|
||||
auto const TestPresetOptionalTruncationHelper =
|
||||
cmJSONOptionalHelper<cmCTestTypes::TruncationMode, ReadFileResult>(
|
||||
ReadFileResult::READ_OK, TestPresetOutputTruncationHelper);
|
||||
|
||||
auto const TestPresetOptionalOutputHelper =
|
||||
cmJSONOptionalHelper<TestPreset::OutputOptions, ReadFileResult>(
|
||||
ReadFileResult::READ_OK,
|
||||
@@ -121,7 +117,7 @@ auto const TestPresetOptionalOutputHelper =
|
||||
cmCMakePresetsGraphInternal::PresetOptionalIntHelper, false)
|
||||
.Bind("testOutputTruncation"_s,
|
||||
&TestPreset::OutputOptions::TestOutputTruncation,
|
||||
TestPresetOptionalTruncationHelper, false)
|
||||
TestPresetOutputTruncationHelper, false)
|
||||
.Bind("maxTestNameWidth"_s, &TestPreset::OutputOptions::MaxTestNameWidth,
|
||||
cmCMakePresetsGraphInternal::PresetOptionalIntHelper, false));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user