summaryrefslogtreecommitdiffstats
path: root/Tests/TestsWorkingDirectory/CMakeLists.txt
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2010-12-16 21:50:34 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2010-12-16 21:50:48 (GMT)
commit9bf4165437ed3ba4480b39cc9000f08f86fbe186 (patch)
tree24446cee2b7260d095ec55ff41b8c3d26c170dc1 /Tests/TestsWorkingDirectory/CMakeLists.txt
parent42de5d02dddec69ee045b423fbd58751f210839d (diff)
downloadCMake-9bf4165437ed3ba4480b39cc9000f08f86fbe186.zip
CMake-9bf4165437ed3ba4480b39cc9000f08f86fbe186.tar.gz
CMake-9bf4165437ed3ba4480b39cc9000f08f86fbe186.tar.bz2
Add tests for WORKING_DIRECTORY arg to add_test
Diffstat (limited to 'Tests/TestsWorkingDirectory/CMakeLists.txt')
-rw-r--r--Tests/TestsWorkingDirectory/CMakeLists.txt21
1 files changed, 21 insertions, 0 deletions
diff --git a/Tests/TestsWorkingDirectory/CMakeLists.txt b/Tests/TestsWorkingDirectory/CMakeLists.txt
index 5fbcd2a..d5c786b 100644
--- a/Tests/TestsWorkingDirectory/CMakeLists.txt
+++ b/Tests/TestsWorkingDirectory/CMakeLists.txt
@@ -27,3 +27,24 @@ get_filename_component(_default_cwd "${_wd_exe}" ABSOLUTE)
set_tests_properties(WorkingDirectory3 PROPERTIES
PASS_REGULAR_EXPRESSION "Working directory: ${_default_cwd}"
)
+
+add_test(NAME WorkingDirectory4 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND WorkingDirectory)
+add_test(NAME WorkingDirectory5 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/.. COMMAND WorkingDirectory)
+add_test(WorkingDirectory6 WorkingDirectory WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/..)
+
+set_tests_properties(WorkingDirectory4 PROPERTIES
+ PASS_REGULAR_EXPRESSION "Working directory: ${CMAKE_BINARY_DIR}"
+)
+
+string(REGEX REPLACE "/[^/]*$" "" _parent_dir "${CMAKE_BINARY_DIR}")
+
+set_tests_properties(WorkingDirectory5 PROPERTIES
+ PASS_REGULAR_EXPRESSION "Working directory: ${_parent_dir}"
+)
+
+string(REGEX REPLACE "/[^/]*$" "" _wd_exe "${CMAKE_BINARY_DIR}")
+get_filename_component(_default_cwd "${_wd_exe}" ABSOLUTE)
+
+set_tests_properties(WorkingDirectory6 PROPERTIES
+ PASS_REGULAR_EXPRESSION "Working directory: ${_default_cwd}"
+)