Commit 85b286f0 authored by Sebastien Barre's avatar Sebastien Barre
Browse files

ENH: add a more stressing FOREACH test.

parent 1623dc21
......@@ -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
......
......@@ -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
#
......
......@@ -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
......
......@@ -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
......
......@@ -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
#
......
......@@ -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
......
......@@ -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
......
......@@ -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
#
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment