summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMakePresetsTest
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2022-02-02 16:30:56 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2022-02-02 20:17:30 (GMT)
commitc18409cdac4d9a8213201eaec53b3cc2d60c68e3 (patch)
tree27cf6445a79d9d8cb99a08209c6de2844e93f91c /Tests/RunCMake/CMakePresetsTest
parent92459258108c0036808f29f83a8503fea18ccee9 (diff)
downloadCMake-c18409cdac4d9a8213201eaec53b3cc2d60c68e3.zip
CMake-c18409cdac4d9a8213201eaec53b3cc2d60c68e3.tar.gz
CMake-c18409cdac4d9a8213201eaec53b3cc2d60c68e3.tar.bz2
CMakePresets.json: Ensure configurePreset is reachable from current file
Diffstat (limited to 'Tests/RunCMake/CMakePresetsTest')
-rw-r--r--Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable-test-x-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable-test-x-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable.json.in9
-rw-r--r--Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachableUser.json.in8
-rw-r--r--Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake1
5 files changed, 21 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable-test-x-result.txt b/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable-test-x-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable-test-x-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable-test-x-stderr.txt b/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable-test-x-stderr.txt
new file mode 100644
index 0000000..d49148d
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable-test-x-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error: Could not read presets from [^
+]*/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable: Configure preset is unreachable from preset's file$
diff --git a/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable.json.in b/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable.json.in
new file mode 100644
index 0000000..cc2f149
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable.json.in
@@ -0,0 +1,9 @@
+{
+ "version": 4,
+ "testPresets": [
+ {
+ "name": "x",
+ "configurePreset": "x"
+ }
+ ]
+}
diff --git a/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachableUser.json.in b/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachableUser.json.in
new file mode 100644
index 0000000..5319af0
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachableUser.json.in
@@ -0,0 +1,8 @@
+{
+ "version": 4,
+ "configurePresets": [
+ {
+ "name": "x"
+ }
+ ]
+}
diff --git a/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake
index 70d25d4..bec0dd94 100644
--- a/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake
@@ -106,6 +106,7 @@ set(CMakePresets_SCHEMA_EXPECTED_RESULT 1)
run_cmake_test_presets(PresetsUnsupported "" "" "x")
run_cmake_test_presets(ConditionFuture "" "" "x")
set(CMakePresets_SCHEMA_EXPECTED_RESULT 0)
+run_cmake_test_presets(ConfigurePresetUnreachable "" "" "x")
set(CMakePresetsTest_NO_CONFIGURE 0)
set(CMakePresetsTest_NO_BUILD 0)