summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-08-07 15:53:28 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-08-07 15:53:39 (GMT)
commitade507f64caad8f763ae011da4bdf99453e8bcd8 (patch)
tree22ddde70f2e4af75bab28fb4bc58180697d6e286 /Tests
parent9a849fcec4bfe29286d61741ff545765137597c3 (diff)
parent20c23518d9947325198c727c77860d3877f61de5 (diff)
downloadCMake-ade507f64caad8f763ae011da4bdf99453e8bcd8.zip
CMake-ade507f64caad8f763ae011da4bdf99453e8bcd8.tar.gz
CMake-ade507f64caad8f763ae011da4bdf99453e8bcd8.tar.bz2
Merge topic 'set-CACHE-diagnostics'
20c23518d9 set: Improve diagnostics for CACHE mode Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8679
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/set/CacheErrors-result.txt1
-rw-r--r--Tests/RunCMake/set/CacheErrors-stderr.txt19
-rw-r--r--Tests/RunCMake/set/CacheErrors.cmake4
-rw-r--r--Tests/RunCMake/set/RunCMakeTest.cmake1
4 files changed, 25 insertions, 0 deletions
diff --git a/Tests/RunCMake/set/CacheErrors-result.txt b/Tests/RunCMake/set/CacheErrors-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/set/CacheErrors-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/set/CacheErrors-stderr.txt b/Tests/RunCMake/set/CacheErrors-stderr.txt
new file mode 100644
index 0000000..9983160
--- /dev/null
+++ b/Tests/RunCMake/set/CacheErrors-stderr.txt
@@ -0,0 +1,19 @@
+^CMake Error at CacheErrors\.cmake:1 \(set\):
+ set given invalid arguments for CACHE mode: missing type and docstring
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CacheErrors\.cmake:2 \(set\):
+ set given invalid arguments for CACHE mode: missing type or docstring
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CacheErrors\.cmake:3 \(set\):
+ set given invalid arguments for CACHE mode: missing type or docstring
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CacheErrors\.cmake:4 \(set\):
+ set given invalid arguments: FORCE specified without CACHE
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/set/CacheErrors.cmake b/Tests/RunCMake/set/CacheErrors.cmake
new file mode 100644
index 0000000..d177474
--- /dev/null
+++ b/Tests/RunCMake/set/CacheErrors.cmake
@@ -0,0 +1,4 @@
+set (var val CACHE)
+set (var val CACHE STRING)
+set (var val CACHE "")
+set (var val CACH3 STRING "" FORCE)
diff --git a/Tests/RunCMake/set/RunCMakeTest.cmake b/Tests/RunCMake/set/RunCMakeTest.cmake
index b3bd0a4..c785450 100644
--- a/Tests/RunCMake/set/RunCMakeTest.cmake
+++ b/Tests/RunCMake/set/RunCMakeTest.cmake
@@ -1,5 +1,6 @@
include(RunCMake)
+run_cmake(CacheErrors)
run_cmake(ParentScope)
run_cmake(ParentPulling)
run_cmake(ParentPullingRecursive)