summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorTaylor Holberton <taylorcholberton@gmail.com>2019-02-01 00:26:14 (GMT)
committerBrad King <brad.king@kitware.com>2019-02-01 11:10:34 (GMT)
commitcb01b8c8ba1754b40e74d89d2c6dfef5dc8c44d3 (patch)
tree0c56204b6befc2f9ce85c397d7410bc5f5ccb994 /Tests/RunCMake
parentd526327079e23748dd2a87acd4d9b4b1174725bf (diff)
downloadCMake-cb01b8c8ba1754b40e74d89d2c6dfef5dc8c44d3.zip
CMake-cb01b8c8ba1754b40e74d89d2c6dfef5dc8c44d3.tar.gz
CMake-cb01b8c8ba1754b40e74d89d2c6dfef5dc8c44d3.tar.bz2
set: warn of extra arguments after ENV value.
Fixes: #18842
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/set/ExtraEnvValue-stderr.txt6
-rw-r--r--Tests/RunCMake/set/ExtraEnvValue.cmake1
-rw-r--r--Tests/RunCMake/set/RunCMakeTest.cmake1
3 files changed, 8 insertions, 0 deletions
diff --git a/Tests/RunCMake/set/ExtraEnvValue-stderr.txt b/Tests/RunCMake/set/ExtraEnvValue-stderr.txt
new file mode 100644
index 0000000..f61f9d2
--- /dev/null
+++ b/Tests/RunCMake/set/ExtraEnvValue-stderr.txt
@@ -0,0 +1,6 @@
+CMake Warning \(dev\) at ExtraEnvValue.cmake:1 \(set\):
+ Only the first value argument is used when setting an environment variable.
+ Argument 'value_2' and later are unused.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/set/ExtraEnvValue.cmake b/Tests/RunCMake/set/ExtraEnvValue.cmake
new file mode 100644
index 0000000..768a6ea
--- /dev/null
+++ b/Tests/RunCMake/set/ExtraEnvValue.cmake
@@ -0,0 +1 @@
+set (ENV{sample_key} value_1 value_2)
diff --git a/Tests/RunCMake/set/RunCMakeTest.cmake b/Tests/RunCMake/set/RunCMakeTest.cmake
index ea63d0b..b3bd0a4 100644
--- a/Tests/RunCMake/set/RunCMakeTest.cmake
+++ b/Tests/RunCMake/set/RunCMakeTest.cmake
@@ -4,3 +4,4 @@ run_cmake(ParentScope)
run_cmake(ParentPulling)
run_cmake(ParentPullingRecursive)
run_cmake(UnknownCacheType)
+run_cmake(ExtraEnvValue)