summaryrefslogtreecommitdiffstats
path: root/Tests/StringFileTest/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/StringFileTest/CMakeLists.txt')
-rw-r--r--Tests/StringFileTest/CMakeLists.txt19
1 files changed, 19 insertions, 0 deletions
diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt
index 74b99ec..c0a904d 100644
--- a/Tests/StringFileTest/CMakeLists.txt
+++ b/Tests/StringFileTest/CMakeLists.txt
@@ -73,3 +73,22 @@ FILE(GLOB src_files "${expr}")
MESSAGE("Globbed files [${src_files}].")
ADD_EXECUTABLE(StringFileTest ${src_files})
+
+# Test FOREACH range
+MESSAGE("Cheack if FOREACH with RANGE works")
+MACRO(TEST_RANGE ARGS CHECK)
+ SET(r)
+ FOREACH(a RANGE ${ARGS})
+ SET(r ${r} ${a})
+ ENDFOREACH(a)
+ MESSAGE("FOREACH with RANGE ${ARGS} produces ${r}")
+ IF("x${r}x" MATCHES "^x${CHECK}x$")
+ ELSE("x${r}x" MATCHES "^x${CHECK}x$")
+ MESSAGE(SEND_ERROR "The range resulted in: ${r} should be ${CHECK}")
+ ENDIF("x${r}x" MATCHES "^x${CHECK}x$")
+ENDMACRO(TEST_RANGE)
+TEST_RANGE("5" "0;1;2;3;4;5")
+TEST_RANGE("3;5" "3;4;5")
+TEST_RANGE("5;3" "5;4;3")
+TEST_RANGE("3;10;2" "3;5;7;9")
+TEST_RANGE("10;0;-3" "10;7;4;1")