summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/GeneratorExpression/CMakeLists.txt4
-rw-r--r--Tests/GeneratorExpression/echo.c3
-rw-r--r--Tests/GeneratorExpression/srcgenex.c12
3 files changed, 15 insertions, 4 deletions
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index 8ac3419..83fd11d 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -258,11 +258,13 @@ add_custom_target(check-part4 ALL
VERBATIM
)
+add_executable(srcgenex srcgenex.c)
+set_property(SOURCE srcgenex.c PROPERTY COMPILE_FLAGS "-DNAME=$<TARGET_PROPERTY:NAME>")
+
#-----------------------------------------------------------------------------
# Cover test properties with generator expressions.
add_executable(echo echo.c)
add_executable(pwd pwd.c)
-set_property(SOURCE echo.c PROPERTY COMPILE_FLAGS $<1:-DSRC_GENEX_WORKS>)
add_test(NAME echo-configuration COMMAND echo $<CONFIGURATION>)
set_property(TEST echo-configuration PROPERTY
diff --git a/Tests/GeneratorExpression/echo.c b/Tests/GeneratorExpression/echo.c
index 41596a2..06b0844 100644
--- a/Tests/GeneratorExpression/echo.c
+++ b/Tests/GeneratorExpression/echo.c
@@ -3,9 +3,6 @@
int main(int argc, char* argv[])
{
-#ifndef SRC_GENEX_WORKS
-#error SRC_GENEX_WORKS not defined
-#endif
printf("%s\n", argv[1]);
return EXIT_SUCCESS;
}
diff --git a/Tests/GeneratorExpression/srcgenex.c b/Tests/GeneratorExpression/srcgenex.c
new file mode 100644
index 0000000..56d3c3f
--- /dev/null
+++ b/Tests/GeneratorExpression/srcgenex.c
@@ -0,0 +1,12 @@
+int srcgenex(void)
+{
+ return 0;
+}
+
+int main(int argc, char* argv[])
+{
+#ifndef NAME
+#error NAME not defined
+#endif
+ return NAME();
+}