diff options
16 files changed, 49 insertions, 10 deletions
diff --git a/Tests/RunCMake/CMakePresetsBuild/Invalid.json.in b/Tests/RunCMake/CMakePresetsBuild/Invalid.json.in index cf56cef..c22fdec 100644 --- a/Tests/RunCMake/CMakePresetsBuild/Invalid.json.in +++ b/Tests/RunCMake/CMakePresetsBuild/Invalid.json.in @@ -18,10 +18,6 @@ "environment": { "TEST": "$vendor{bad.TEST}" } - }, - { - "name": "badConfigurePreset", - "configurePreset": "dne" } ] } diff --git a/Tests/RunCMake/CMakePresetsBuild/InvalidConfigurePreset-build-badConfigurePreset-result.txt b/Tests/RunCMake/CMakePresetsBuild/InvalidConfigurePreset-build-badConfigurePreset-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresetsBuild/InvalidConfigurePreset-build-badConfigurePreset-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresetsBuild/InvalidConfigurePreset-build-badConfigurePreset-stderr.txt b/Tests/RunCMake/CMakePresetsBuild/InvalidConfigurePreset-build-badConfigurePreset-stderr.txt new file mode 100644 index 0000000..303632e --- /dev/null +++ b/Tests/RunCMake/CMakePresetsBuild/InvalidConfigurePreset-build-badConfigurePreset-stderr.txt @@ -0,0 +1,2 @@ +CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresetsBuild/InvalidConfigurePreset: Invalid "configurePreset" field diff --git a/Tests/RunCMake/CMakePresetsBuild/InvalidConfigurePreset-configure-default-result.txt b/Tests/RunCMake/CMakePresetsBuild/InvalidConfigurePreset-configure-default-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresetsBuild/InvalidConfigurePreset-configure-default-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresetsBuild/InvalidConfigurePreset-configure-default-stderr.txt b/Tests/RunCMake/CMakePresetsBuild/InvalidConfigurePreset-configure-default-stderr.txt new file mode 100644 index 0000000..303632e --- /dev/null +++ b/Tests/RunCMake/CMakePresetsBuild/InvalidConfigurePreset-configure-default-stderr.txt @@ -0,0 +1,2 @@ +CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresetsBuild/InvalidConfigurePreset: Invalid "configurePreset" field diff --git a/Tests/RunCMake/CMakePresetsBuild/InvalidConfigurePreset.cmake b/Tests/RunCMake/CMakePresetsBuild/InvalidConfigurePreset.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsBuild/InvalidConfigurePreset.cmake diff --git a/Tests/RunCMake/CMakePresetsBuild/InvalidConfigurePreset.json.in b/Tests/RunCMake/CMakePresetsBuild/InvalidConfigurePreset.json.in new file mode 100644 index 0000000..c0429d5 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsBuild/InvalidConfigurePreset.json.in @@ -0,0 +1,16 @@ +{ + "version": 2, + "configurePresets": [ + { + "name": "default", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build/${presetName}" + } + ], + "buildPresets": [ + { + "name": "badConfigurePreset", + "configurePreset": "dne" + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake index fd95c2c..2559b12 100644 --- a/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake @@ -63,11 +63,12 @@ endfunction() set(CMakePresets_SCHEMA_EXPECTED_RESULT 0) run_cmake_build_presets(Good "default;other" "build-other;withEnvironment;noEnvironment;macros;vendorObject") +run_cmake_build_presets(InvalidConfigurePreset "default" "badConfigurePreset") set(CMakePresetsBuild_BUILD_ONLY 1) run_cmake_build_presets(ListPresets "x" "x" "--list-presets") run_cmake_build_presets(NoConfigurePreset "x" "noConfigurePreset") -run_cmake_build_presets(Invalid "x" "hidden;vendorMacro;badConfigurePreset") +run_cmake_build_presets(Invalid "x" "hidden;vendorMacro") set(CMakePresets_SCHEMA_EXPECTED_RESULT 1) run_cmake_build_presets(PresetsUnsupported "x" "x") diff --git a/Tests/RunCMake/CMakePresetsTest/Invalid.json.in b/Tests/RunCMake/CMakePresetsTest/Invalid.json.in index c7096f2..cfcf4b7 100644 --- a/Tests/RunCMake/CMakePresetsTest/Invalid.json.in +++ b/Tests/RunCMake/CMakePresetsTest/Invalid.json.in @@ -18,10 +18,6 @@ "environment": { "TEST": "$vendor{bad.TEST}" } - }, - { - "name": "badConfigurePreset", - "configurePreset": "dne" } ] } diff --git a/Tests/RunCMake/CMakePresetsTest/InvalidConfigurePreset-configure-default-result.txt b/Tests/RunCMake/CMakePresetsTest/InvalidConfigurePreset-configure-default-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/InvalidConfigurePreset-configure-default-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresetsTest/InvalidConfigurePreset-configure-default-stderr.txt b/Tests/RunCMake/CMakePresetsTest/InvalidConfigurePreset-configure-default-stderr.txt new file mode 100644 index 0000000..3d7cdd0 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/InvalidConfigurePreset-configure-default-stderr.txt @@ -0,0 +1,2 @@ +CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresetsTest/InvalidConfigurePreset: Invalid "configurePreset" field diff --git a/Tests/RunCMake/CMakePresetsTest/InvalidConfigurePreset-test-badConfigurePreset-result.txt b/Tests/RunCMake/CMakePresetsTest/InvalidConfigurePreset-test-badConfigurePreset-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/InvalidConfigurePreset-test-badConfigurePreset-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresetsTest/InvalidConfigurePreset-test-badConfigurePreset-stderr.txt b/Tests/RunCMake/CMakePresetsTest/InvalidConfigurePreset-test-badConfigurePreset-stderr.txt new file mode 100644 index 0000000..3d7cdd0 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/InvalidConfigurePreset-test-badConfigurePreset-stderr.txt @@ -0,0 +1,2 @@ +CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresetsTest/InvalidConfigurePreset: Invalid "configurePreset" field diff --git a/Tests/RunCMake/CMakePresetsTest/InvalidConfigurePreset.cmake b/Tests/RunCMake/CMakePresetsTest/InvalidConfigurePreset.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/InvalidConfigurePreset.cmake diff --git a/Tests/RunCMake/CMakePresetsTest/InvalidConfigurePreset.json.in b/Tests/RunCMake/CMakePresetsTest/InvalidConfigurePreset.json.in new file mode 100644 index 0000000..e305c42 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/InvalidConfigurePreset.json.in @@ -0,0 +1,16 @@ +{ + "version": 2, + "configurePresets": [ + { + "name": "default", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build/${presetName}" + } + ], + "testPresets": [ + { + "name": "badConfigurePreset", + "configurePreset": "dne" + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake index 4ffdfab..c93dff3 100644 --- a/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake @@ -85,6 +85,8 @@ run_cmake_test_presets(Good "${GoodTestPresets}") unset(CMakePresetsTest_ASSETS) +run_cmake_test_presets(InvalidConfigurePreset "default" "" "badConfigurePreset") + set(CMakePresetsTest_NO_CONFIGURE 1) set(CMakePresetsTest_FILE "${RunCMake_SOURCE_DIR}/Good.json.in") run_cmake_test_presets(ListPresets "" "" "x" "--list-presets") @@ -92,7 +94,7 @@ unset(CMakePresetsTest_FILE) run_cmake_test_presets(NoConfigurePreset "" "" "noConfigurePreset") run_cmake_test_presets(NoTestsAction "default" "" "noTestsAction") -run_cmake_test_presets(Invalid "" "" "hidden;vendorMacro;badConfigurePreset") +run_cmake_test_presets(Invalid "" "" "hidden;vendorMacro") set(CMakePresets_SCHEMA_EXPECTED_RESULT 1) run_cmake_test_presets(PresetsUnsupported "" "" "x") |