summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
diff options
context:
space:
mode:
authorR2RT <artur.ryt@gmail.com>2018-04-08 20:56:44 (GMT)
committerBrad King <brad.king@kitware.com>2018-04-09 15:59:07 (GMT)
commitaad360eb3d07fc34048f3065e2d3617fa07f2932 (patch)
tree8149a890d1e37916ab34deaeeedf9beb541c4fa5 /Tests/RunCMake/CommandLine/RunCMakeTest.cmake
parent61fd4c742013a7f9139db190f936703b656540ff (diff)
downloadCMake-aad360eb3d07fc34048f3065e2d3617fa07f2932.zip
CMake-aad360eb3d07fc34048f3065e2d3617fa07f2932.tar.gz
CMake-aad360eb3d07fc34048f3065e2d3617fa07f2932.tar.bz2
Fix crash with --trace-expand --warn-uninitialized together
Some code paths in `ExpandVariablesInString{New,Old}` were not checking the `filename` parameter for a null pointer, but this can happen when using the above flags together. Add the checks and a test case. Fixes: #17896
Diffstat (limited to 'Tests/RunCMake/CommandLine/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 55eac5e..120a472 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -294,6 +294,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)