summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/test/ctest_helpers.cmake
diff options
context:
space:
mode:
authorChenhao Qu <chenhao.qu@mongodb.com>2021-08-27 06:51:45 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-08-27 07:14:01 +0000
commit5549a374759b453eb0b217731eac885a209c2912 (patch)
treef51176e09aa6c16a6f2deb37242ec5075d2e0b27 /src/third_party/wiredtiger/test/ctest_helpers.cmake
parent8c28dc9f87bfbe86a7254305d42db044f6b16100 (diff)
downloadmongo-5549a374759b453eb0b217731eac885a209c2912.tar.gz
Import wiredtiger: 5daf583c8323da025d86a24b2669f8e72840e2dd from branch mongodb-master
ref: 5449d025d9..5daf583c83 for: 5.1.0 WT-7996 More column-store C testing
Diffstat (limited to 'src/third_party/wiredtiger/test/ctest_helpers.cmake')
-rw-r--r--src/third_party/wiredtiger/test/ctest_helpers.cmake16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/third_party/wiredtiger/test/ctest_helpers.cmake b/src/third_party/wiredtiger/test/ctest_helpers.cmake
index 622aea84160..1a8a7b4152e 100644
--- a/src/third_party/wiredtiger/test/ctest_helpers.cmake
+++ b/src/third_party/wiredtiger/test/ctest_helpers.cmake
@@ -229,6 +229,13 @@ macro(define_c_test)
if(NOT "${C_TEST_FLAGS}" STREQUAL "")
list(APPEND additional_executable_args FLAGS ${C_TEST_FLAGS})
endif()
+ set(exec_wrapper)
+ if(WT_WIN)
+ # This is a workaround to run our csuite tests under Windows using CTest. When executing a test,
+ # CTests by-passes the shell and directly executes the test as a child process. In doing so CTest executes the binary with forward-slash paths.
+ # Which while technically valid breaks assumptions in our testing utilities. Wrap the execution in powershell to avoid this.
+ set(exec_wrapper "powershell.exe")
+ endif()
if (C_TEST_SMOKE)
# csuite test comes with a smoke execution wrapper.
create_test_executable(${C_TEST_TARGET}
@@ -238,7 +245,7 @@ macro(define_c_test)
${additional_executable_args}
)
add_test(NAME ${C_TEST_TARGET}
- COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${C_TEST_DIR_NAME}/smoke.sh ${C_TEST_ARGUMENTS} $<TARGET_FILE:${C_TEST_TARGET}>
+ COMMAND ${exec_wrapper} ${CMAKE_CURRENT_BINARY_DIR}/${C_TEST_DIR_NAME}/smoke.sh ${C_TEST_ARGUMENTS} $<TARGET_FILE:${C_TEST_TARGET}>
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${C_TEST_DIR_NAME}
)
else()
@@ -253,13 +260,6 @@ macro(define_c_test)
# Ensure each DB home directory is run under the tests working directory.
set(command_args -h ${wt_test_home_dir})
list(APPEND command_args ${C_TEST_ARGUMENTS})
- set(exec_wrapper)
- if(WT_WIN)
- # This is a workaround to run our csuite tests under Windows using CTest. When executing a test,
- # CTests by-passes the shell and directly executes the test as a child process. In doing so CTest executes the binary with forward-slash paths.
- # Which while technically valid breaks assumptions in our testing utilities. Wrap the execution in powershell to avoid this.
- set(exec_wrapper "powershell.exe")
- endif()
add_test(NAME ${C_TEST_TARGET}
COMMAND ${exec_wrapper} $<TARGET_FILE:${C_TEST_TARGET}> ${command_args}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${C_TEST_DIR_NAME}