summaryrefslogtreecommitdiffstats
path: root/Tests/GeneratorExpression
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-10-20 12:14:20 (GMT)
committerStephen Kelly <steveire@gmail.com>2012-10-20 12:23:47 (GMT)
commit4bacff7a4c1fa26d7c1fb93471578c8f67c96fdc (patch)
tree75a900017adcab1c4f50b079b6ab023ae4d3fbda /Tests/GeneratorExpression
parent982905c0d23aded548718cf64665002cac350e77 (diff)
downloadCMake-4bacff7a4c1fa26d7c1fb93471578c8f67c96fdc.zip
CMake-4bacff7a4c1fa26d7c1fb93471578c8f67c96fdc.tar.gz
CMake-4bacff7a4c1fa26d7c1fb93471578c8f67c96fdc.tar.bz2
GenEx: Test early determination of AND and OR
It should be possible for example to do this: "$<AND:${FOO},$<BOOL:${TGT}>,$<BOOL:$<TARGET_PROPERTY:${TGT},PROP>" such that it works simliarly to the C code: if (foo && tgt && tgt->prop()) { } The example of generator expression code is a little bit contrived as it could be written other ways with the same functionality. Nevertheless, as these cases already work and are intentional, test for them.
Diffstat (limited to 'Tests/GeneratorExpression')
-rw-r--r--Tests/GeneratorExpression/CMakeLists.txt4
-rw-r--r--Tests/GeneratorExpression/check.cmake2
2 files changed, 6 insertions, 0 deletions
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index 891fa11..581d483 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -14,6 +14,9 @@ add_custom_target(check ALL
-Dtest_and_1=$<AND:1>
-Dtest_and_1_0=$<AND:1,0>
-Dtest_and_1_1=$<AND:1,1>
+ # Ordinarily, the 'invalidcontent' would cause an error, but
+ # the '0' makes the AND abort early.
+ -Dtest_and_0_invalidcontent=$<AND:0,invalidcontent>
-Dtest_config_0=$<CONFIG:$<CONFIGURATION>x>
-Dtest_config_1=$<CONFIG:$<CONFIGURATION>>
-Dtest_not_0=$<NOT:0>
@@ -24,6 +27,7 @@ add_custom_target(check ALL
-Dtest_or_1=$<OR:1>
-Dtest_or_1_0=$<OR:1,0>
-Dtest_or_1_1=$<OR:1,1>
+ -Dtest_or_1_invalidcontent=$<OR:1,invalidcontent>
-Dtest_bool_notfound=$<BOOL:NOTFOUND>
-Dtest_bool_foo_notfound=$<BOOL:Foo-NOTFOUND>
-Dtest_bool_true=$<BOOL:True>
diff --git a/Tests/GeneratorExpression/check.cmake b/Tests/GeneratorExpression/check.cmake
index 8ffa481..88a60ce 100644
--- a/Tests/GeneratorExpression/check.cmake
+++ b/Tests/GeneratorExpression/check.cmake
@@ -15,6 +15,7 @@ check(test_and_0_1 "0")
check(test_and_1 "1")
check(test_and_1_0 "0")
check(test_and_1_1 "1")
+check(test_and_0_invalidcontent "0")
check(test_config_0 "0")
check(test_config_1 "1")
check(test_not_0 "1")
@@ -25,6 +26,7 @@ check(test_or_0_1 "1")
check(test_or_1 "1")
check(test_or_1_0 "1")
check(test_or_1_1 "1")
+check(test_or_1_invalidcontent "1")
check(test_bool_notfound "0")
check(test_bool_foo_notfound "0")
check(test_bool_true "1")