summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-04-10 15:32:44 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-04-10 15:32:56 (GMT)
commit5c10e8f6080dcf5dd66f19bb7753208604b8988c (patch)
tree294d8f2e0b006422f12beed9b8061ba6d94ece89 /Tests
parent9fabee00ca8d3f15a05ac3216b755e27843f2fac (diff)
parentaad360eb3d07fc34048f3065e2d3617fa07f2932 (diff)
downloadCMake-5c10e8f6080dcf5dd66f19bb7753208604b8988c.zip
CMake-5c10e8f6080dcf5dd66f19bb7753208604b8988c.tar.gz
CMake-5c10e8f6080dcf5dd66f19bb7753208604b8988c.tar.bz2
Merge topic 'fix-crash-trace-exp-uninit-vars'
aad360eb3d Fix crash with --trace-expand --warn-uninitialized together Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1944
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/CommandLine/trace-expand-warn-uninitialized-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/trace-expand-warn-uninitialized.cmake4
3 files changed, 10 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 5df2fbf..d8dbeec 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -287,6 +287,10 @@ set(RunCMake_TEST_OPTIONS --trace-expand)
run_cmake(trace-expand)
unset(RunCMake_TEST_OPTIONS)
+set(RunCMake_TEST_OPTIONS --trace-expand --warn-uninitialized)
+run_cmake(trace-expand-warn-uninitialized)
+unset(RunCMake_TEST_OPTIONS)
+
set(RunCMake_TEST_OPTIONS --trace-source=trace-only-this-file.cmake)
run_cmake(trace-source)
unset(RunCMake_TEST_OPTIONS)
diff --git a/Tests/RunCMake/CommandLine/trace-expand-warn-uninitialized-stderr.txt b/Tests/RunCMake/CommandLine/trace-expand-warn-uninitialized-stderr.txt
new file mode 100644
index 0000000..74429b6
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/trace-expand-warn-uninitialized-stderr.txt
@@ -0,0 +1,2 @@
+^.*/Tests/RunCMake/CommandLine/CMakeLists.txt\(1\): cmake_minimum_required\(VERSION 3.0 \)
+.*/Tests/RunCMake/CommandLine/CMakeLists.txt\(2\): project\(trace-expand-warn-uninitialized NONE \)
diff --git a/Tests/RunCMake/CommandLine/trace-expand-warn-uninitialized.cmake b/Tests/RunCMake/CommandLine/trace-expand-warn-uninitialized.cmake
new file mode 100644
index 0000000..ec3e4d4
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/trace-expand-warn-uninitialized.cmake
@@ -0,0 +1,4 @@
+cmake_policy(SET CMP0053 OLD)
+message(STATUS "'${uninitialized_variable}'")
+cmake_policy(SET CMP0053 NEW)
+message(STATUS "'${uninitialized_variable}'")