diff options
author | Brad King <brad.king@kitware.com> | 2009-07-22 17:42:27 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-07-22 17:42:27 (GMT) |
commit | 267085f338c917f72950ca55f5cc09760cb4a894 (patch) | |
tree | a4ac1073f902f5d895c000d926b6bfe05fcefa4f | |
parent | c64b1456b64d5d479cc3bbd27370b1e5b46fa4d0 (diff) | |
download | CMake-267085f338c917f72950ca55f5cc09760cb4a894.zip CMake-267085f338c917f72950ca55f5cc09760cb4a894.tar.gz CMake-267085f338c917f72950ca55f5cc09760cb4a894.tar.bz2 |
ENH: Improve strictness of Function test
The command "set(... PARENT_SCOPE)" should never affect the calling
scope. This improves the Function test to check that such calls in a
subdirectory scope affect the parent but not the child.
-rw-r--r-- | Tests/FunctionTest/SubDirScope/CMakeLists.txt | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Tests/FunctionTest/SubDirScope/CMakeLists.txt b/Tests/FunctionTest/SubDirScope/CMakeLists.txt index b67d30e..4a53d2c 100644 --- a/Tests/FunctionTest/SubDirScope/CMakeLists.txt +++ b/Tests/FunctionTest/SubDirScope/CMakeLists.txt @@ -1,4 +1,14 @@ -SET(SUBDIR_DEFINED 1) -SET(SUBDIR_UNDEFINED) -SET(SUBDIR_DEFINED ${SUBDIR_DEFINED} PARENT_SCOPE) -SET(SUBDIR_UNDEFINED ${SUBDIR_UNDEFINED} PARENT_SCOPE) +SET(SUBDIR_DEFINED 1 PARENT_SCOPE) +SET(SUBDIR_UNDEFINED PARENT_SCOPE) + +# The above sets should not affect the current scope. +IF(DEFINED SUBDIR_UNDEFINED) + PASS("SubdirScope Undefine Test" "(${SUBDIR_UNDEFINED})") +ELSE(DEFINED SUBDIR_UNDEFINED) + FAILED("SubdirScope Undefine Test" "(${SUBDIR_UNDEFINED})") +ENDIF(DEFINED SUBDIR_UNDEFINED) +IF(DEFINED SUBDIR_DEFINED) + FAILED("SubdirScope Define Test" "(${SUBDIR_DEFINED})") +ELSE(DEFINED SUBDIR_DEFINED) + PASS("SubdirScope Define Test" "(${SUBDIR_DEFINED})") +ENDIF(DEFINED SUBDIR_DEFINED) |