summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorJeremy <51220084+jeremy-rifkin@users.noreply.github.com>2023-08-02 00:29:58 (GMT)
committerBrad King <brad.king@kitware.com>2023-08-02 14:07:56 (GMT)
commit20c23518d9947325198c727c77860d3877f61de5 (patch)
tree3bb5210f61a3bde80872d2063f8580ea896ff926 /Tests
parent17dcd9424aefdfa10b72ad3d3bfe35e186cad02b (diff)
downloadCMake-20c23518d9947325198c727c77860d3877f61de5.zip
CMake-20c23518d9947325198c727c77860d3877f61de5.tar.gz
CMake-20c23518d9947325198c727c77860d3877f61de5.tar.bz2
set: Improve diagnostics for CACHE mode
Improve `set()` diagnostics to be more specific than given invalid arguments for CACHE mode
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)