summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-11-24 14:12:58 (GMT)
committerBrad King <brad.king@kitware.com>2015-11-24 14:30:16 (GMT)
commit378185fb7f672113257502ef96cf7106c22dd39f (patch)
tree70c84d7d5d4a76b7f9a25875cea47f70437051d4
parent29c1385675df37146465e820d303de3cdd703e8c (diff)
downloadCMake-378185fb7f672113257502ef96cf7106c22dd39f.zip
CMake-378185fb7f672113257502ef96cf7106c22dd39f.tar.gz
CMake-378185fb7f672113257502ef96cf7106c22dd39f.tar.bz2
Tests: Add case for unmatched cmake_policy({PUSH,POP})
-rw-r--r--Tests/RunCMake/PolicyScope/NotClosed-result.txt1
-rw-r--r--Tests/RunCMake/PolicyScope/NotClosed-stderr.txt4
-rw-r--r--Tests/RunCMake/PolicyScope/NotClosed.cmake1
-rw-r--r--Tests/RunCMake/PolicyScope/NotOpened-result.txt1
-rw-r--r--Tests/RunCMake/PolicyScope/NotOpened-stderr.txt4
-rw-r--r--Tests/RunCMake/PolicyScope/NotOpened.cmake1
-rw-r--r--Tests/RunCMake/PolicyScope/RunCMakeTest.cmake2
7 files changed, 14 insertions, 0 deletions
diff --git a/Tests/RunCMake/PolicyScope/NotClosed-result.txt b/Tests/RunCMake/PolicyScope/NotClosed-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/PolicyScope/NotClosed-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/PolicyScope/NotClosed-stderr.txt b/Tests/RunCMake/PolicyScope/NotClosed-stderr.txt
new file mode 100644
index 0000000..293d161
--- /dev/null
+++ b/Tests/RunCMake/PolicyScope/NotClosed-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at NotClosed.cmake:[0-9]+ \(include\):
+ cmake_policy PUSH without matching POP
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/PolicyScope/NotClosed.cmake b/Tests/RunCMake/PolicyScope/NotClosed.cmake
new file mode 100644
index 0000000..19b880e
--- /dev/null
+++ b/Tests/RunCMake/PolicyScope/NotClosed.cmake
@@ -0,0 +1 @@
+cmake_policy(PUSH)
diff --git a/Tests/RunCMake/PolicyScope/NotOpened-result.txt b/Tests/RunCMake/PolicyScope/NotOpened-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/PolicyScope/NotOpened-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/PolicyScope/NotOpened-stderr.txt b/Tests/RunCMake/PolicyScope/NotOpened-stderr.txt
new file mode 100644
index 0000000..f27aac8
--- /dev/null
+++ b/Tests/RunCMake/PolicyScope/NotOpened-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at NotOpened.cmake:[0-9]+ \(cmake_policy\):
+ cmake_policy POP without matching PUSH
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/PolicyScope/NotOpened.cmake b/Tests/RunCMake/PolicyScope/NotOpened.cmake
new file mode 100644
index 0000000..bb9f3a3
--- /dev/null
+++ b/Tests/RunCMake/PolicyScope/NotOpened.cmake
@@ -0,0 +1 @@
+cmake_policy(POP)
diff --git a/Tests/RunCMake/PolicyScope/RunCMakeTest.cmake b/Tests/RunCMake/PolicyScope/RunCMakeTest.cmake
index d6c021f..abd27f4 100644
--- a/Tests/RunCMake/PolicyScope/RunCMakeTest.cmake
+++ b/Tests/RunCMake/PolicyScope/RunCMakeTest.cmake
@@ -1,4 +1,6 @@
include(RunCMake)
+run_cmake(NotClosed)
+run_cmake(NotOpened)
run_cmake(parent-dir-generate-time)
run_cmake(dir-in-macro-generate-time)