summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorSebastien Barre <sebastien.barre@kitware.com>2002-03-27 18:54:31 (GMT)
committerSebastien Barre <sebastien.barre@kitware.com>2002-03-27 18:54:31 (GMT)
commit85b286f04e85f8acb8add3fb6d00d362d34f72dc (patch)
tree3283e51323f46865dbceb3df966807719f28acea /Tests
parent1623dc2183996810c00417e9bc532ce38f7c893e (diff)
downloadCMake-85b286f04e85f8acb8add3fb6d00d362d34f72dc.zip
CMake-85b286f04e85f8acb8add3fb6d00d362d34f72dc.tar.gz
CMake-85b286f04e85f8acb8add3fb6d00d362d34f72dc.tar.bz2
ENH: add a more stressing FOREACH test.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Complex/Executable/complex.cxx15
-rw-r--r--Tests/Complex/VarTests.cmake5
-rw-r--r--Tests/Complex/cmTestConfigure.h.in1
-rw-r--r--Tests/ComplexOneConfig/Executable/complex.cxx15
-rw-r--r--Tests/ComplexOneConfig/VarTests.cmake5
-rw-r--r--Tests/ComplexOneConfig/cmTestConfigure.h.in1
-rw-r--r--Tests/ComplexRelativePaths/Executable/complex.cxx15
-rw-r--r--Tests/ComplexRelativePaths/VarTests.cmake5
-rw-r--r--Tests/ComplexRelativePaths/cmTestConfigure.h.in1
9 files changed, 63 insertions, 0 deletions
diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx
index 454b2c6..f1fe92d 100644
--- a/Tests/Complex/Executable/complex.cxx
+++ b/Tests/Complex/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/Complex/VarTests.cmake b/Tests/Complex/VarTests.cmake
index 5c444f5..48d04c1 100644
--- a/Tests/Complex/VarTests.cmake
+++ b/Tests/Complex/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/Complex/cmTestConfigure.h.in b/Tests/Complex/cmTestConfigure.h.in
index 2ea6388..0d4caee 100644
--- a/Tests/Complex/cmTestConfigure.h.in
+++ b/Tests/Complex/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
diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx
index 454b2c6..f1fe92d 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 5c444f5..48d04c1 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 2ea6388..0d4caee 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
diff --git a/Tests/ComplexRelativePaths/Executable/complex.cxx b/Tests/ComplexRelativePaths/Executable/complex.cxx
index 454b2c6..f1fe92d 100644
--- a/Tests/ComplexRelativePaths/Executable/complex.cxx
+++ b/Tests/ComplexRelativePaths/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/ComplexRelativePaths/VarTests.cmake b/Tests/ComplexRelativePaths/VarTests.cmake
index 5c444f5..48d04c1 100644
--- a/Tests/ComplexRelativePaths/VarTests.cmake
+++ b/Tests/ComplexRelativePaths/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/ComplexRelativePaths/cmTestConfigure.h.in b/Tests/ComplexRelativePaths/cmTestConfigure.h.in
index 2ea6388..0d4caee 100644
--- a/Tests/ComplexRelativePaths/cmTestConfigure.h.in
+++ b/Tests/ComplexRelativePaths/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