summaryrefslogtreecommitdiff
path: root/Tests/ComplexOneConfig
diff options
context:
space:
mode:
authorSebastien Barre <sebastien.barre@kitware.com>2002-03-27 13:54:31 -0500
committerSebastien Barre <sebastien.barre@kitware.com>2002-03-27 13:54:31 -0500
commit85b286f04e85f8acb8add3fb6d00d362d34f72dc (patch)
tree3283e51323f46865dbceb3df966807719f28acea /Tests/ComplexOneConfig
parent1623dc2183996810c00417e9bc532ce38f7c893e (diff)
downloadcmake-85b286f04e85f8acb8add3fb6d00d362d34f72dc.tar.gz
ENH: add a more stressing FOREACH test.
Diffstat (limited to 'Tests/ComplexOneConfig')
-rw-r--r--Tests/ComplexOneConfig/Executable/complex.cxx15
-rw-r--r--Tests/ComplexOneConfig/VarTests.cmake5
-rw-r--r--Tests/ComplexOneConfig/cmTestConfigure.h.in1
3 files changed, 21 insertions, 0 deletions
diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx
index 454b2c6c5b..f1fe92db8c 100644
--- a/Tests/ComplexOneConfig/Executable/complex.cxx
+++ b/Tests/ComplexOneConfig/Executable/complex.cxx
@@ -359,6 +359,21 @@ int main()
}
#endif
+#ifndef FOREACH_CONCAT
+ cmFailed("the FOREACH, SET or CONFIGURE_FILE command is broken, "
+ "FOREACH_CONCAT is not defined.");
+#else
+ if(strcmp(FOREACH_CONCAT, "abcdefg") != 0)
+ {
+ cmFailed("the FOREACH, SET or CONFIGURE_FILE command is broken, "
+ "FOREACH_CONCAT == ", FOREACH_CONCAT);
+ }
+ else
+ {
+ cmPassed("FOREACH_CONCAT == ", FOREACH_CONCAT);
+ }
+#endif
+
// ----------------------------------------------------------------------
// Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations
diff --git a/Tests/ComplexOneConfig/VarTests.cmake b/Tests/ComplexOneConfig/VarTests.cmake
index 5c444f5728..48d04c1006 100644
--- a/Tests/ComplexOneConfig/VarTests.cmake
+++ b/Tests/ComplexOneConfig/VarTests.cmake
@@ -102,6 +102,11 @@ FOREACH (INDEX 1 2)
SET(FOREACH_VAR${INDEX} "VALUE${INDEX}")
ENDFOREACH(INDEX)
+SET(FOREACH_CONCAT "")
+FOREACH (INDEX "a;b;c;d;e;f;g")
+ SET(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}")
+ENDFOREACH(INDEX)
+
#
# Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations
#
diff --git a/Tests/ComplexOneConfig/cmTestConfigure.h.in b/Tests/ComplexOneConfig/cmTestConfigure.h.in
index 2ea6388ee1..0d4caeea57 100644
--- a/Tests/ComplexOneConfig/cmTestConfigure.h.in
+++ b/Tests/ComplexOneConfig/cmTestConfigure.h.in
@@ -10,6 +10,7 @@
#define FOREACH_VAR1 "${FOREACH_VAR1}"
#define FOREACH_VAR2 "${FOREACH_VAR2}"
+#define FOREACH_CONCAT "${FOREACH_CONCAT}"
// Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations