diff options
author | Sam Freed <safreed@microsoft.com> | 2021-03-15 21:45:59 (GMT) |
---|---|---|
committer | Sam Freed <safreed@microsoft.com> | 2021-03-15 21:53:00 (GMT) |
commit | b9eb3541cf16fd393183e077257f21061d25c521 (patch) | |
tree | 2c05396ec475d28c62d72afd80417a1686c55c57 /Tests/RunCMake/CMakePresetsBuild | |
parent | 83eeeff7dc0cf5c298d8696096926c57cd6cff5e (diff) | |
download | CMake-b9eb3541cf16fd393183e077257f21061d25c521.zip CMake-b9eb3541cf16fd393183e077257f21061d25c521.tar.gz CMake-b9eb3541cf16fd393183e077257f21061d25c521.tar.bz2 |
Tests: update tests to catch invalid configurePreset at read-time
Diffstat (limited to 'Tests/RunCMake/CMakePresetsBuild')
8 files changed, 24 insertions, 5 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") |