diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2022-10-18 18:27:46 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2022-10-18 18:40:11 (GMT) |
commit | b68c3596e7e9c1390d17b36163cd60aa12ead028 (patch) | |
tree | bf066bed088ec3f47cc9a41c8f034bb5d0712da8 | |
parent | 787fc8caa8c46b7c29e05c9b367f8e85665845d4 (diff) | |
download | CMake-b68c3596e7e9c1390d17b36163cd60aa12ead028.zip CMake-b68c3596e7e9c1390d17b36163cd60aa12ead028.tar.gz CMake-b68c3596e7e9c1390d17b36163cd60aa12ead028.tar.bz2 |
CMakePresets.json: Disallow extra properties in test output schema
And add test for testOutputTruncation being unsupported.
5 files changed, 73 insertions, 3 deletions
diff --git a/Help/manual/presets/schema.json b/Help/manual/presets/schema.json index b4db700..23bfae7 100644 --- a/Help/manual/presets/schema.json +++ b/Help/manual/presets/schema.json @@ -1073,7 +1073,24 @@ "environment": {}, "configuration": {}, "overwriteConfigurationFile": {}, - "output": {}, + "output": { + "type": "object", + "properties": { + "shortProgress": {}, + "verbosity": {}, + "debug": {}, + "outputOnFailure": {}, + "quiet": {}, + "outputLogFile": {}, + "labelSummary": {}, + "subprojectSummary": {}, + "maxPassedTestOutputSize": {}, + "maxFailedTestOutputSize": {}, + "maxTestNameWidth": {}, + "testOutputTruncation": {} + }, + "additionalProperties": false + }, "filter": {}, "execution": {}, "condition": {} @@ -1105,7 +1122,23 @@ "environment": {}, "configuration": {}, "overwriteConfigurationFile": {}, - "output": {}, + "output": { + "type": "object", + "properties": { + "shortProgress": {}, + "verbosity": {}, + "debug": {}, + "outputOnFailure": {}, + "quiet": {}, + "outputLogFile": {}, + "labelSummary": {}, + "subprojectSummary": {}, + "maxPassedTestOutputSize": {}, + "maxFailedTestOutputSize": {}, + "maxTestNameWidth": {} + }, + "additionalProperties": false + }, "filter": {}, "execution": {}, "condition": {} @@ -1136,7 +1169,23 @@ "environment": {}, "configuration": {}, "overwriteConfigurationFile": {}, - "output": {}, + "output": { + "type": "object", + "properties": { + "shortProgress": {}, + "verbosity": {}, + "debug": {}, + "outputOnFailure": {}, + "quiet": {}, + "outputLogFile": {}, + "labelSummary": {}, + "subprojectSummary": {}, + "maxPassedTestOutputSize": {}, + "maxFailedTestOutputSize": {}, + "maxTestNameWidth": {} + }, + "additionalProperties": false + }, "filter": {}, "execution": {} }, diff --git a/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake index bec0dd94..e9e8395 100644 --- a/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake @@ -105,6 +105,7 @@ run_cmake_test_presets(Invalid "" "" "hidden;vendorMacro") set(CMakePresets_SCHEMA_EXPECTED_RESULT 1) run_cmake_test_presets(PresetsUnsupported "" "" "x") run_cmake_test_presets(ConditionFuture "" "" "x") +run_cmake_test_presets(TestOutputTruncationUnsupported "" "" "x") set(CMakePresets_SCHEMA_EXPECTED_RESULT 0) run_cmake_test_presets(ConfigurePresetUnreachable "" "" "x") set(CMakePresetsTest_NO_CONFIGURE 0) diff --git a/Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported-test-x-result.txt b/Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported-test-x-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported-test-x-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported-test-x-stderr.txt b/Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported-test-x-stderr.txt new file mode 100644 index 0000000..90ea7c3 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported-test-x-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported: File version must be 5 or higher for testOutputTruncation preset support\.$ diff --git a/Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported.json.in b/Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported.json.in new file mode 100644 index 0000000..c116039 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported.json.in @@ -0,0 +1,17 @@ +{ + "version": 4, + "configurePresets": [ + { + "name": "default" + } + ], + "testPresets": [ + { + "name": "default", + "configurePreset": "default", + "output": { + "testOutputTruncation": "tail" + } + } + ] +} |