From ba3b7c1588abf9009895e47a93a0614bec484315 Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Thu, 30 Jun 2005 13:39:38 -0400 Subject: ENH: added testing of the WHILE command --- Tests/Complex/CMakeLists.txt | 5 +++++ Tests/Complex/Executable/complex.cxx | 12 ++++++++++++ Tests/Complex/cmTestConfigure.h.in | 3 +++ Tests/ComplexOneConfig/CMakeLists.txt | 5 +++++ Tests/ComplexOneConfig/Executable/complex.cxx | 12 ++++++++++++ Tests/ComplexOneConfig/cmTestConfigure.h.in | 3 +++ Tests/ComplexRelativePaths/CMakeLists.txt | 5 +++++ Tests/ComplexRelativePaths/Executable/complex.cxx | 12 ++++++++++++ Tests/ComplexRelativePaths/cmTestConfigure.h.in | 3 +++ 9 files changed, 60 insertions(+) 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}" -- cgit v0.12