summaryrefslogtreecommitdiffstats
path: root/Tests
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
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')
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable-build-x-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable-build-x-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable.json.in9
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachableUser.json.in8
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake2
-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
10 files changed, 43 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable-build-x-result.txt b/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable-build-x-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable-build-x-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable-build-x-stderr.txt b/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable-build-x-stderr.txt
new file mode 100644
index 0000000..05695d9
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable-build-x-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error: Could not read presets from [^
+]*/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable: Configure preset is unreachable from preset's file$
diff --git a/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable.json.in b/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable.json.in
new file mode 100644
index 0000000..f1db4fb
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable.json.in
@@ -0,0 +1,9 @@
+{
+ "version": 4,
+ "buildPresets": [
+ {
+ "name": "x",
+ "configurePreset": "x"
+ }
+ ]
+}
diff --git a/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachableUser.json.in b/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachableUser.json.in
new file mode 100644
index 0000000..5319af0
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachableUser.json.in
@@ -0,0 +1,8 @@
+{
+ "version": 4,
+ "configurePresets": [
+ {
+ "name": "x"
+ }
+ ]
+}
diff --git a/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake
index 2fe0407..1ededc1 100644
--- a/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake
@@ -83,4 +83,6 @@ set(CMakePresets_SCHEMA_EXPECTED_RESULT 1)
run_cmake_build_presets(PresetsUnsupported "x" "x")
run_cmake_build_presets(ConditionFuture "x" "conditionFuture")
set(CMakePresets_SCHEMA_EXPECTED_RESULT 0)
+
+run_cmake_build_presets(ConfigurePresetUnreachable "x" "x")
set(CMakePresetsBuild_BUILD_ONLY 0)
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)