summaryrefslogtreecommitdiffstats
path: root/Tests/TestsWorkingDirectory/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/TestsWorkingDirectory/CMakeLists.txt')
-rw-r--r--Tests/TestsWorkingDirectory/CMakeLists.txt8
1 files changed, 3 insertions, 5 deletions
diff --git a/Tests/TestsWorkingDirectory/CMakeLists.txt b/Tests/TestsWorkingDirectory/CMakeLists.txt
index c0e780c..d1c40d6 100644
--- a/Tests/TestsWorkingDirectory/CMakeLists.txt
+++ b/Tests/TestsWorkingDirectory/CMakeLists.txt
@@ -5,6 +5,8 @@ add_executable(WorkingDirectory main.cxx)
enable_testing()
+set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
+
add_test(NAME WorkingDirectory1 COMMAND WorkingDirectory)
add_test(NAME WorkingDirectory2 COMMAND WorkingDirectory)
add_test(WorkingDirectory3 WorkingDirectory)
@@ -21,8 +23,7 @@ set_tests_properties(WorkingDirectory2 PROPERTIES
PASS_REGULAR_EXPRESSION "Working directory: -->${_parent_dir}<--"
)
-string(REGEX REPLACE "/[^/]*$" "" _wd_exe "${CMAKE_BINARY_DIR}")
-get_filename_component(_default_cwd "${_wd_exe}" ABSOLUTE)
+get_filename_component(_default_cwd "${EXECUTABLE_OUTPUT_PATH}" PATH)
set_tests_properties(WorkingDirectory3 PROPERTIES
PASS_REGULAR_EXPRESSION "Working directory: -->${_default_cwd}<--"
@@ -42,9 +43,6 @@ 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}<--"
)