diff options
author | Brad King <brad.king@kitware.com> | 2014-11-26 18:50:47 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-11-26 18:50:47 (GMT) |
commit | 82582c96bd86969ee5e1cc6f7bc4e5b12e1717e1 (patch) | |
tree | 3b47d49ccd16f09b7281f16600d553ea8b44b630 /Tests | |
parent | 106c769f1d46a2410ff62c3dd4cd02cd1da7fd37 (diff) | |
parent | d54617d0068fc5acfa2079d1e8de8f38365564ab (diff) | |
download | CMake-82582c96bd86969ee5e1cc6f7bc4e5b12e1717e1.zip CMake-82582c96bd86969ee5e1cc6f7bc4e5b12e1717e1.tar.gz CMake-82582c96bd86969ee5e1cc6f7bc4e5b12e1717e1.tar.bz2 |
Merge topic 'break-command-strictness'
d54617d0 break: Add policy CMP0055 to check calls strictly
bae604d9 Track nested loop levels in CMake language with a stack of counters
Diffstat (limited to 'Tests')
21 files changed, 73 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0055/CMP0055-NEW-Out-of-Scope-result.txt b/Tests/RunCMake/CMP0055/CMP0055-NEW-Out-of-Scope-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMP0055/CMP0055-NEW-Out-of-Scope-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMP0055/CMP0055-NEW-Out-of-Scope-stderr.txt b/Tests/RunCMake/CMP0055/CMP0055-NEW-Out-of-Scope-stderr.txt new file mode 100644 index 0000000..27e8140 --- /dev/null +++ b/Tests/RunCMake/CMP0055/CMP0055-NEW-Out-of-Scope-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at CMP0055-NEW-Out-of-Scope.cmake:4 \(break\): + A BREAK command was found outside of a proper FOREACH or WHILE loop scope. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0055/CMP0055-NEW-Out-of-Scope.cmake b/Tests/RunCMake/CMP0055/CMP0055-NEW-Out-of-Scope.cmake new file mode 100644 index 0000000..53ac214 --- /dev/null +++ b/Tests/RunCMake/CMP0055/CMP0055-NEW-Out-of-Scope.cmake @@ -0,0 +1,4 @@ + +cmake_policy(SET CMP0055 NEW) + +break() diff --git a/Tests/RunCMake/CMP0055/CMP0055-NEW-Reject-Arguments-result.txt b/Tests/RunCMake/CMP0055/CMP0055-NEW-Reject-Arguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMP0055/CMP0055-NEW-Reject-Arguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMP0055/CMP0055-NEW-Reject-Arguments-stderr.txt b/Tests/RunCMake/CMP0055/CMP0055-NEW-Reject-Arguments-stderr.txt new file mode 100644 index 0000000..32947af --- /dev/null +++ b/Tests/RunCMake/CMP0055/CMP0055-NEW-Reject-Arguments-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at CMP0055-NEW-Reject-Arguments.cmake:5 \(break\): + The BREAK command does not accept any arguments. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0055/CMP0055-NEW-Reject-Arguments.cmake b/Tests/RunCMake/CMP0055/CMP0055-NEW-Reject-Arguments.cmake new file mode 100644 index 0000000..52eaa6a --- /dev/null +++ b/Tests/RunCMake/CMP0055/CMP0055-NEW-Reject-Arguments.cmake @@ -0,0 +1,6 @@ + +cmake_policy(SET CMP0055 NEW) + +foreach(i RANGE 1 2) + break(1) +endforeach()
\ No newline at end of file diff --git a/Tests/RunCMake/CMP0055/CMP0055-OLD-Out-of-Scope-result.txt b/Tests/RunCMake/CMP0055/CMP0055-OLD-Out-of-Scope-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0055/CMP0055-OLD-Out-of-Scope-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0055/CMP0055-OLD-Out-of-Scope-stderr.txt b/Tests/RunCMake/CMP0055/CMP0055-OLD-Out-of-Scope-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/CMP0055/CMP0055-OLD-Out-of-Scope-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CMP0055/CMP0055-OLD-Out-of-Scope.cmake b/Tests/RunCMake/CMP0055/CMP0055-OLD-Out-of-Scope.cmake new file mode 100644 index 0000000..57195c2 --- /dev/null +++ b/Tests/RunCMake/CMP0055/CMP0055-OLD-Out-of-Scope.cmake @@ -0,0 +1,4 @@ + +cmake_policy(SET CMP0055 OLD) + +break() diff --git a/Tests/RunCMake/CMP0055/CMP0055-OLD-Reject-Arguments-result.txt b/Tests/RunCMake/CMP0055/CMP0055-OLD-Reject-Arguments-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0055/CMP0055-OLD-Reject-Arguments-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0055/CMP0055-OLD-Reject-Arguments-stderr.txt b/Tests/RunCMake/CMP0055/CMP0055-OLD-Reject-Arguments-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/CMP0055/CMP0055-OLD-Reject-Arguments-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CMP0055/CMP0055-OLD-Reject-Arguments.cmake b/Tests/RunCMake/CMP0055/CMP0055-OLD-Reject-Arguments.cmake new file mode 100644 index 0000000..d8fdddf --- /dev/null +++ b/Tests/RunCMake/CMP0055/CMP0055-OLD-Reject-Arguments.cmake @@ -0,0 +1,6 @@ + +cmake_policy(SET CMP0055 OLD) + +foreach(i RANGE 1 2) + break(1) +endforeach()
\ No newline at end of file diff --git a/Tests/RunCMake/CMP0055/CMP0055-WARN-Out-of-Scope-result.txt b/Tests/RunCMake/CMP0055/CMP0055-WARN-Out-of-Scope-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0055/CMP0055-WARN-Out-of-Scope-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0055/CMP0055-WARN-Out-of-Scope-stderr.txt b/Tests/RunCMake/CMP0055/CMP0055-WARN-Out-of-Scope-stderr.txt new file mode 100644 index 0000000..ad850ac --- /dev/null +++ b/Tests/RunCMake/CMP0055/CMP0055-WARN-Out-of-Scope-stderr.txt @@ -0,0 +1,9 @@ +CMake Warning \(dev\) at CMP0055-WARN-Out-of-Scope.cmake:2 \(break\): + Policy CMP0055 is not set: Strict checking for break\(\) command. Run "cmake + --help-policy CMP0055" for policy details. Use the cmake_policy command to + set the policy and suppress this warning. + + A BREAK command was found outside of a proper FOREACH or WHILE loop scope. +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/CMP0055/CMP0055-WARN-Out-of-Scope.cmake b/Tests/RunCMake/CMP0055/CMP0055-WARN-Out-of-Scope.cmake new file mode 100644 index 0000000..373a95a --- /dev/null +++ b/Tests/RunCMake/CMP0055/CMP0055-WARN-Out-of-Scope.cmake @@ -0,0 +1,2 @@ + +break() diff --git a/Tests/RunCMake/CMP0055/CMP0055-WARN-Reject-Arguments-result.txt b/Tests/RunCMake/CMP0055/CMP0055-WARN-Reject-Arguments-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0055/CMP0055-WARN-Reject-Arguments-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0055/CMP0055-WARN-Reject-Arguments-stderr.txt b/Tests/RunCMake/CMP0055/CMP0055-WARN-Reject-Arguments-stderr.txt new file mode 100644 index 0000000..3cc686d --- /dev/null +++ b/Tests/RunCMake/CMP0055/CMP0055-WARN-Reject-Arguments-stderr.txt @@ -0,0 +1,9 @@ +CMake Warning \(dev\) at CMP0055-WARN-Reject-Arguments.cmake:3 \(break\): + Policy CMP0055 is not set: Strict checking for break\(\) command. Run "cmake + --help-policy CMP0055" for policy details. Use the cmake_policy command to + set the policy and suppress this warning. + + The BREAK command does not accept any arguments. +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/CMP0055/CMP0055-WARN-Reject-Arguments.cmake b/Tests/RunCMake/CMP0055/CMP0055-WARN-Reject-Arguments.cmake new file mode 100644 index 0000000..ec6b90f --- /dev/null +++ b/Tests/RunCMake/CMP0055/CMP0055-WARN-Reject-Arguments.cmake @@ -0,0 +1,4 @@ + +foreach(i RANGE 1 2) + break(1) +endforeach() diff --git a/Tests/RunCMake/CMP0055/CMakeLists.txt b/Tests/RunCMake/CMP0055/CMakeLists.txt new file mode 100644 index 0000000..ef2163c --- /dev/null +++ b/Tests/RunCMake/CMP0055/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.1) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0055/RunCMakeTest.cmake b/Tests/RunCMake/CMP0055/RunCMakeTest.cmake new file mode 100644 index 0000000..efcfcab --- /dev/null +++ b/Tests/RunCMake/CMP0055/RunCMakeTest.cmake @@ -0,0 +1,9 @@ +include(RunCMake) + +run_cmake(CMP0055-OLD-Out-of-Scope) +run_cmake(CMP0055-NEW-Out-of-Scope) +run_cmake(CMP0055-WARN-Out-of-Scope) + +run_cmake(CMP0055-OLD-Reject-Arguments) +run_cmake(CMP0055-NEW-Reject-Arguments) +run_cmake(CMP0055-WARN-Reject-Arguments) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 8e6bad4..9832a95 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -49,6 +49,7 @@ add_RunCMake_test(CMP0050) add_RunCMake_test(CMP0051) add_RunCMake_test(CMP0053) add_RunCMake_test(CMP0054) +add_RunCMake_test(CMP0055) add_RunCMake_test(CTest) if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja") add_RunCMake_test(CompilerChange) |