summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/foreach
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-21 12:55:21 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-09-21 12:55:29 (GMT)
commitca5e30994049066f1bffc0635b3411bc5cacc6f9 (patch)
treedb3f2176997ef40310887320b1106d4e0db7ac1f /Tests/RunCMake/foreach
parent4abf0747fccf04c16e48567dfc6d0f4a403dc96e (diff)
parent0412b55b838fd337dfa510db1b9be3a44f4f7de2 (diff)
downloadCMake-ca5e30994049066f1bffc0635b3411bc5cacc6f9.zip
CMake-ca5e30994049066f1bffc0635b3411bc5cacc6f9.tar.gz
CMake-ca5e30994049066f1bffc0635b3411bc5cacc6f9.tar.bz2
Merge topic 'foreach-int-parse-range-check'
0412b55b83 foreach: Fix crash parsing integer out of range Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5239
Diffstat (limited to 'Tests/RunCMake/foreach')
-rw-r--r--Tests/RunCMake/foreach/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test-result.txt1
-rw-r--r--Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test-stderr.txt4
-rw-r--r--Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test.cmake3
4 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/foreach/RunCMakeTest.cmake b/Tests/RunCMake/foreach/RunCMakeTest.cmake
index 22a0a75..d3f7c23 100644
--- a/Tests/RunCMake/foreach/RunCMakeTest.cmake
+++ b/Tests/RunCMake/foreach/RunCMakeTest.cmake
@@ -19,3 +19,4 @@ run_cmake(foreach-RANGE-non-int-test-3-1)
run_cmake(foreach-RANGE-non-int-test-3-2)
run_cmake(foreach-RANGE-non-int-test-3-3)
run_cmake(foreach-RANGE-invalid-test)
+run_cmake(foreach-RANGE-out-of-range-test)
diff --git a/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test-result.txt b/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test-stderr.txt b/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test-stderr.txt
new file mode 100644
index 0000000..f05f864
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at foreach-RANGE-out-of-range-test\.cmake:[0-9]+ \(foreach\):
+ foreach Integer out of range: '10000000000000000000'
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:3 \(include\)$
diff --git a/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test.cmake b/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test.cmake
new file mode 100644
index 0000000..3099ca9
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test.cmake
@@ -0,0 +1,3 @@
+foreach(a RANGE 10000000000000000000)
+ break()
+endforeach()