summaryrefslogtreecommitdiffstats
path: root/Tests/TestsWorkingDirectory/subdir
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2011-01-20 18:47:53 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2011-01-20 18:47:53 (GMT)
commit0594287606dad64904935901d5625b4f47d61ef6 (patch)
treea7d8ef426e945f1594052767790ef2a6f0bacbad /Tests/TestsWorkingDirectory/subdir
parent6529d7f67e05903ca29347c3220a0c91ce1f2905 (diff)
downloadCMake-0594287606dad64904935901d5625b4f47d61ef6.zip
CMake-0594287606dad64904935901d5625b4f47d61ef6.tar.gz
CMake-0594287606dad64904935901d5625b4f47d61ef6.tar.bz2
Add more tests for WorkingDirectory for tests
Diffstat (limited to 'Tests/TestsWorkingDirectory/subdir')
-rw-r--r--Tests/TestsWorkingDirectory/subdir/CMakeLists.txt31
1 files changed, 31 insertions, 0 deletions
diff --git a/Tests/TestsWorkingDirectory/subdir/CMakeLists.txt b/Tests/TestsWorkingDirectory/subdir/CMakeLists.txt
new file mode 100644
index 0000000..523f02e
--- /dev/null
+++ b/Tests/TestsWorkingDirectory/subdir/CMakeLists.txt
@@ -0,0 +1,31 @@
+add_test(NAME WorkingDirectory-Subdir0 COMMAND WorkingDirectory "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_test(NAME WorkingDirectory-Subdir1 COMMAND WorkingDirectory "${CMAKE_CURRENT_BINARY_DIR}")
+set_tests_properties(WorkingDirectory-Subdir1 PROPERTIES
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+)
+
+string(REGEX REPLACE "/[^/]*$" "" _parent_dir "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_test(NAME WorkingDirectory-Subdir2 COMMAND WorkingDirectory "${_parent_dir}")
+set_tests_properties(WorkingDirectory-Subdir2 PROPERTIES
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+)
+
+set(_default_cwd "${CMAKE_CURRENT_BINARY_DIR}")
+
+# FIXME: How to deal with /debug, /release, etc. with VS or XCode?
+if(${CMAKE_GENERATOR} MATCHES "Makefiles")
+add_test(WorkingDirectory-Subdir3 ${EXECUTABLE_OUTPUT_PATH}/WorkingDirectory ${_default_cwd})
+endif()
+
+add_test(NAME WorkingDirectory-Subdir4 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND WorkingDirectory ${CMAKE_CURRENT_BINARY_DIR})
+
+string(REGEX REPLACE "/[^/]*$" "" _parent_dir "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_test(NAME WorkingDirectory-Subdir5 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/.. COMMAND WorkingDirectory ${_parent_dir})
+
+# FIXME: How to deal with /debug, /release, etc. with VS or XCode?
+if(${CMAKE_GENERATOR} MATCHES "Makefiles")
+add_test(WorkingDirectory-Subdir6 ${EXECUTABLE_OUTPUT_PATH}/WorkingDirectory ${_default_cwd} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/..)
+endif()