summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2005-06-30 17:39:38 (GMT)
committerKen Martin <ken.martin@kitware.com>2005-06-30 17:39:38 (GMT)
commitba3b7c1588abf9009895e47a93a0614bec484315 (patch)
treeb15e17d83a19b6752ba34a18fd4a3e8e08ee8de0 /Tests
parent8ea0a1a2373f76cb78a0890932f115aad0fb8df5 (diff)
downloadCMake-ba3b7c1588abf9009895e47a93a0614bec484315.zip
CMake-ba3b7c1588abf9009895e47a93a0614bec484315.tar.gz
CMake-ba3b7c1588abf9009895e47a93a0614bec484315.tar.bz2
ENH: added testing of the WHILE command
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Complex/CMakeLists.txt5
-rw-r--r--Tests/Complex/Executable/complex.cxx12
-rw-r--r--Tests/Complex/cmTestConfigure.h.in3
-rw-r--r--Tests/ComplexOneConfig/CMakeLists.txt5
-rw-r--r--Tests/ComplexOneConfig/Executable/complex.cxx12
-rw-r--r--Tests/ComplexOneConfig/cmTestConfigure.h.in3
-rw-r--r--Tests/ComplexRelativePaths/CMakeLists.txt5
-rw-r--r--Tests/ComplexRelativePaths/Executable/complex.cxx12
-rw-r--r--Tests/ComplexRelativePaths/cmTestConfigure.h.in3
9 files changed, 60 insertions, 0 deletions
diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt
index ca186bb..35f8ef2 100644
--- a/Tests/Complex/CMakeLists.txt
+++ b/Tests/Complex/CMakeLists.txt
@@ -237,6 +237,11 @@ FOREACH(x "a")
ENDIF(${x} MATCHES "a")
ENDFOREACH(x)
+# test WHILE command
+SET (while_var 1)
+WHILE (while_var LESS 1000)
+ SET(while_var ${while_var}0)
+ENDWHILE(while_var LESS 1000)
#
# Configure file
diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx
index 6c62da3..85fe299 100644
--- a/Tests/Complex/Executable/complex.cxx
+++ b/Tests/Complex/Executable/complex.cxx
@@ -657,6 +657,18 @@ int main()
#endif
// ----------------------------------------------------------------------
+ // Test WHILE
+
+ if(WHILE_VALUE != 1000)
+ {
+ cmFailed("WHILE command is not working");
+ }
+ else
+ {
+ cmPassed("WHILE command is working");
+ }
+
+ // ----------------------------------------------------------------------
// Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations
#ifndef FILENAME_VAR_PATH_NAME
diff --git a/Tests/Complex/cmTestConfigure.h.in b/Tests/Complex/cmTestConfigure.h.in
index 0d380b1..35c10b4 100644
--- a/Tests/Complex/cmTestConfigure.h.in
+++ b/Tests/Complex/cmTestConfigure.h.in
@@ -12,6 +12,9 @@
#define FOREACH_VAR2 "${FOREACH_VAR2}"
#define FOREACH_CONCAT "${FOREACH_CONCAT}"
+// Test WHILE
+#define WHILE_VALUE ${while_var}
+
// Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations
#define FILENAME_VAR_PATH_NAME "${FILENAME_VAR_PATH_NAME}"
diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt
index ca186bb..35f8ef2 100644
--- a/Tests/ComplexOneConfig/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/CMakeLists.txt
@@ -237,6 +237,11 @@ FOREACH(x "a")
ENDIF(${x} MATCHES "a")
ENDFOREACH(x)
+# test WHILE command
+SET (while_var 1)
+WHILE (while_var LESS 1000)
+ SET(while_var ${while_var}0)
+ENDWHILE(while_var LESS 1000)
#
# Configure file
diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx
index 6c62da3..85fe299 100644
--- a/Tests/ComplexOneConfig/Executable/complex.cxx
+++ b/Tests/ComplexOneConfig/Executable/complex.cxx
@@ -657,6 +657,18 @@ int main()
#endif
// ----------------------------------------------------------------------
+ // Test WHILE
+
+ if(WHILE_VALUE != 1000)
+ {
+ cmFailed("WHILE command is not working");
+ }
+ else
+ {
+ cmPassed("WHILE command is working");
+ }
+
+ // ----------------------------------------------------------------------
// Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations
#ifndef FILENAME_VAR_PATH_NAME
diff --git a/Tests/ComplexOneConfig/cmTestConfigure.h.in b/Tests/ComplexOneConfig/cmTestConfigure.h.in
index 0d380b1..35c10b4 100644
--- a/Tests/ComplexOneConfig/cmTestConfigure.h.in
+++ b/Tests/ComplexOneConfig/cmTestConfigure.h.in
@@ -12,6 +12,9 @@
#define FOREACH_VAR2 "${FOREACH_VAR2}"
#define FOREACH_CONCAT "${FOREACH_CONCAT}"
+// Test WHILE
+#define WHILE_VALUE ${while_var}
+
// Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations
#define FILENAME_VAR_PATH_NAME "${FILENAME_VAR_PATH_NAME}"
diff --git a/Tests/ComplexRelativePaths/CMakeLists.txt b/Tests/ComplexRelativePaths/CMakeLists.txt
index ca186bb..35f8ef2 100644
--- a/Tests/ComplexRelativePaths/CMakeLists.txt
+++ b/Tests/ComplexRelativePaths/CMakeLists.txt
@@ -237,6 +237,11 @@ FOREACH(x "a")
ENDIF(${x} MATCHES "a")
ENDFOREACH(x)
+# test WHILE command
+SET (while_var 1)
+WHILE (while_var LESS 1000)
+ SET(while_var ${while_var}0)
+ENDWHILE(while_var LESS 1000)
#
# Configure file
diff --git a/Tests/ComplexRelativePaths/Executable/complex.cxx b/Tests/ComplexRelativePaths/Executable/complex.cxx
index 6c62da3..85fe299 100644
--- a/Tests/ComplexRelativePaths/Executable/complex.cxx
+++ b/Tests/ComplexRelativePaths/Executable/complex.cxx
@@ -657,6 +657,18 @@ int main()
#endif
// ----------------------------------------------------------------------
+ // Test WHILE
+
+ if(WHILE_VALUE != 1000)
+ {
+ cmFailed("WHILE command is not working");
+ }
+ else
+ {
+ cmPassed("WHILE command is working");
+ }
+
+ // ----------------------------------------------------------------------
// Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations
#ifndef FILENAME_VAR_PATH_NAME
diff --git a/Tests/ComplexRelativePaths/cmTestConfigure.h.in b/Tests/ComplexRelativePaths/cmTestConfigure.h.in
index 0d380b1..35c10b4 100644
--- a/Tests/ComplexRelativePaths/cmTestConfigure.h.in
+++ b/Tests/ComplexRelativePaths/cmTestConfigure.h.in
@@ -12,6 +12,9 @@
#define FOREACH_VAR2 "${FOREACH_VAR2}"
#define FOREACH_CONCAT "${FOREACH_CONCAT}"
+// Test WHILE
+#define WHILE_VALUE ${while_var}
+
// Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations
#define FILENAME_VAR_PATH_NAME "${FILENAME_VAR_PATH_NAME}"