summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/FunctionTest/CMakeLists.txt27
-rw-r--r--Tests/FunctionTest/SubDirScope/CMakeLists.txt3
2 files changed, 30 insertions, 0 deletions
diff --git a/Tests/FunctionTest/CMakeLists.txt b/Tests/FunctionTest/CMakeLists.txt
index 76c2511..5ab9bcd 100644
--- a/Tests/FunctionTest/CMakeLists.txt
+++ b/Tests/FunctionTest/CMakeLists.txt
@@ -83,4 +83,31 @@ FUNCTION(ADD_EXECUTABLE exec)
_ADD_EXECUTABLE(mini${exec} ${ARGN})
ENDFUNCTION(ADD_EXECUTABLE)
+# var undef case
+FUNCTION(undef_var m)
+ SET(${m})
+ RAISE_SCOPE(${m})
+ENDFUNCTION(undef_var)
+SET(FUNCTION_UNDEFINED 1)
+undef_var(FUNCTION_UNDEFINED)
+IF(DEFINED FUNCTION_UNDEFINED)
+ FAILED("Function Undefine Test" "(${FUNCTION_UNDEFINED})")
+ELSE(DEFINED FUNCTION_UNDEFINED)
+ PASS("Function Undefine Test" "(${FUNCTION_UNDEFINED})")
+ENDIF(DEFINED FUNCTION_UNDEFINED)
+
+# Subdirectory scope raise.
+SET(SUBDIR_UNDEFINED 1)
+ADD_SUBDIRECTORY(SubDirScope)
+IF(DEFINED SUBDIR_UNDEFINED)
+ FAILED("Subdir Undefine Test" "(${SUBDIR_UNDEFINED})")
+ELSE(DEFINED SUBDIR_UNDEFINED)
+ PASS("Subdir Undefine Test" "(${SUBDIR_UNDEFINED})")
+ENDIF(DEFINED SUBDIR_UNDEFINED)
+IF(DEFINED SUBDIR_DEFINED)
+ PASS("Subdir Define Test" "(${SUBDIR_DEFINED})")
+ELSE(DEFINED SUBDIR_DEFINED)
+ FAILED("Subdir Define Test" "(${SUBDIR_DEFINED})")
+ENDIF(DEFINED SUBDIR_DEFINED)
+
ADD_EXECUTABLE(FunctionTest functionTest.c)
diff --git a/Tests/FunctionTest/SubDirScope/CMakeLists.txt b/Tests/FunctionTest/SubDirScope/CMakeLists.txt
new file mode 100644
index 0000000..174b9b0
--- /dev/null
+++ b/Tests/FunctionTest/SubDirScope/CMakeLists.txt
@@ -0,0 +1,3 @@
+SET(SUBDIR_DEFINED 1)
+SET(SUBDIR_UNDEFINED)
+RAISE_SCOPE(SUBDIR_DEFINED SUBDIR_UNDEFINED)