diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2012-09-30 08:44:18 (GMT) |
---|---|---|
committer | Rolf Eike Beer <eike@sf-mail.de> | 2012-11-02 16:10:07 (GMT) |
commit | 56125a3f363272568c578c7e329af37d97b24df0 (patch) | |
tree | 67ce2153f7a25772a9d195f2a316b875ee78580a /Tests/CMakeTests/ListTest.cmake.in | |
parent | 48ed48f7ad4c2da8037e997129b5ae8923ab7268 (diff) | |
download | CMake-56125a3f363272568c578c7e329af37d97b24df0.zip CMake-56125a3f363272568c578c7e329af37d97b24df0.tar.gz CMake-56125a3f363272568c578c7e329af37d97b24df0.tar.bz2 |
list: add tests for CMP0007 behavior
Diffstat (limited to 'Tests/CMakeTests/ListTest.cmake.in')
-rw-r--r-- | Tests/CMakeTests/ListTest.cmake.in | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Tests/CMakeTests/ListTest.cmake.in b/Tests/CMakeTests/ListTest.cmake.in index 53559eb..f0ed70f 100644 --- a/Tests/CMakeTests/ListTest.cmake.in +++ b/Tests/CMakeTests/ListTest.cmake.in @@ -155,6 +155,9 @@ foreach(cmd Remove_Item Reverse Remove_Duplicates Sort Remove_At) set(${cmd}-Nonexistent-List-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-${cmd}-Nonexistent-List.cmake:2 \\(list\\):.*sub-command ${Cmd} requires list to be present.*") endforeach() +set(Get-CMP0007-Warn-RESULT 0) +set(Get-CMP0007-Warn-STDERR ".*CMake Warning \\(dev\\) at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-Get-CMP0007-Warn.cmake:3 \\(list\\):.*Policy CMP0007 is not set:.*") + check_cmake_test(List No-Arguments Length-Too-Many-Arguments @@ -170,4 +173,15 @@ check_cmake_test(List Sort-Nonexistent-List Remove_At-Nonexistent-List Remove_At-Invalid-Index + Get-CMP0007-Warn ) + +set(thelist "" NEW OLD) + +foreach (_pol ${thelist}) + cmake_policy(SET CMP0007 ${_pol}) + list(GET thelist 1 thevalue) + if (NOT thevalue STREQUAL _pol) + message(SEND_ERROR "returned element '${thevalue}', but expected '${_pol}'") + endif() +endforeach (_pol) |