summaryrefslogtreecommitdiffstats
path: root/Tests/GeneratorExpression/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-07 19:44:23 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-10-07 19:44:23 (GMT)
commit9939c99bc6c46aaa0639555ebf51d11c50610937 (patch)
tree19a14d15d631587de2cda7a1b7a6589270829b58 /Tests/GeneratorExpression/CMakeLists.txt
parentb53a71bb1b5900c79259ae8745de85e437329b51 (diff)
parent6a47c37ccf7049d5ac3fa6224def8d17ee82c7f5 (diff)
downloadCMake-9939c99bc6c46aaa0639555ebf51d11c50610937.zip
CMake-9939c99bc6c46aaa0639555ebf51d11c50610937.tar.gz
CMake-9939c99bc6c46aaa0639555ebf51d11c50610937.tar.bz2
Merge topic 'test-property-genex'
6a47c37 add_test: Mention generator expressions in old-style add_test docs d331292 cmTestGenerator: Evaluate generator expressions in test properties 6fe5c4a cmTestGenerator: Separate test properties for each configuration
Diffstat (limited to 'Tests/GeneratorExpression/CMakeLists.txt')
-rw-r--r--Tests/GeneratorExpression/CMakeLists.txt32
1 files changed, 31 insertions, 1 deletions
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index 47e7882..e0df8c2 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -1,5 +1,7 @@
cmake_minimum_required (VERSION 2.8.8)
-project(GeneratorExpression CXX)
+project(GeneratorExpression)
+
+include(CTest)
# This test is split into multiple parts as needed to avoid NMake command
# length limits.
@@ -195,3 +197,31 @@ add_custom_target(check-part3 ALL
COMMAND ${CMAKE_COMMAND} -E echo "check done (part 3 of 3)"
VERBATIM
)
+
+#-----------------------------------------------------------------------------
+# Cover test properties with generator expressions.
+add_executable(echo echo.c)
+add_executable(pwd pwd.c)
+
+add_test(NAME echo-configuration COMMAND echo $<CONFIGURATION>)
+set_property(TEST echo-configuration PROPERTY
+ PASS_REGULAR_EXPRESSION "^$<CONFIGURATION>\n$")
+
+add_test(NAME echo-target-file COMMAND echo $<TARGET_FILE:echo>)
+set_property(TEST echo-target-file PROPERTY
+ PASS_REGULAR_EXPRESSION "/echo${CMAKE_EXECUTABLE_SUFFIX}\n$")
+set_property(TEST echo-target-file PROPERTY
+ REQUIRED_FILES "$<TARGET_FILE:echo>")
+
+add_test(NAME working-dir-arg
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/WorkingDirectory/$<CONFIGURATION>"
+ COMMAND pwd)
+set_property(TEST working-dir-arg PROPERTY
+ PASS_REGULAR_EXPRESSION "WorkingDirectory/$<CONFIGURATION>\n$")
+foreach(c ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE})
+ file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/WorkingDirectory/${c}")
+endforeach()
+
+add_test(echo-old-style echo "\$<CONFIGURATION>")
+set_property(TEST echo-old-style PROPERTY
+ PASS_REGULAR_EXPRESSION "^\\$<CONFIGURATION>\n$")