summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-09 14:22:10 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-10-09 14:22:10 (GMT)
commit8424d569f0f347c084e919d5c6037ccadb959dab (patch)
tree52ede225888707eceaefa7546b06a09737d23afc /Tests
parent12a7e2b10c447e3ed61c2bca69f0264f7fcbdef9 (diff)
parent261c248254faf2fc09d71f456f018b7f8bc9a7f1 (diff)
downloadCMake-8424d569f0f347c084e919d5c6037ccadb959dab.zip
CMake-8424d569f0f347c084e919d5c6037ccadb959dab.tar.gz
CMake-8424d569f0f347c084e919d5c6037ccadb959dab.tar.bz2
Merge topic 'unset-PARENT_SCOPE'
261c248 unset: Add PARENT_SCOPE option
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Unset/CMakeLists.txt27
1 files changed, 27 insertions, 0 deletions
diff --git a/Tests/Unset/CMakeLists.txt b/Tests/Unset/CMakeLists.txt
index 781da3f..07aa68e 100644
--- a/Tests/Unset/CMakeLists.txt
+++ b/Tests/Unset/CMakeLists.txt
@@ -51,5 +51,32 @@ if(DEFINED BAR)
message(FATAL_ERROR "BAR still defined")
endif()
+# Test unset(... PARENT_SCOPE)
+function(unset_zots)
+ if(NOT DEFINED ZOT1)
+ message(FATAL_ERROR "ZOT1 is not defined inside function")
+ endif()
+ if(NOT DEFINED ZOT2)
+ message(FATAL_ERROR "ZOT2 is not defined inside function")
+ endif()
+ unset(ZOT1)
+ unset(ZOT2 PARENT_SCOPE)
+ if(DEFINED ZOT1)
+ message(FATAL_ERROR "ZOT1 is defined inside function after unset")
+ endif()
+ if(NOT DEFINED ZOT2)
+ message(FATAL_ERROR
+ "ZOT2 is not defined inside function after unset(... PARENT_SCOPE)")
+ endif()
+endfunction()
+set(ZOT1 1)
+set(ZOT2 2)
+unset_zots()
+if(NOT DEFINED ZOT1)
+ message(FATAL_ERROR "ZOT1 is not still defined after function")
+endif()
+if(DEFINED ZOT2)
+ message(FATAL_ERROR "ZOT2 is still defined after function unset PARENT_SCOPE")
+endif()
add_executable(Unset unset.c)