summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-02-04 12:46:21 +0000
committerKitware Robot <kwrobot@kitware.com>2019-02-04 07:46:29 -0500
commitdc4a2749a52cb7f96ad8d7146ee4d680a2beb5fa (patch)
tree505cfd07eff76667002f775aa9eec8d72253455f /Tests
parentd401c10db5cc5afc009bbb31c4ea11e4914687db (diff)
parentcb01b8c8ba1754b40e74d89d2c6dfef5dc8c44d3 (diff)
downloadcmake-dc4a2749a52cb7f96ad8d7146ee4d680a2beb5fa.tar.gz
Merge topic 'set-env-warning'
cb01b8c8ba set: warn of extra arguments after ENV value. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2903
Diffstat (limited to 'Tests')
-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 0000000000..f61f9d287b
--- /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 0000000000..768a6eac2e
--- /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 ea63d0bdc4..b3bd0a4807 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)