Skip to content

Commit 0061e24

Browse files
committed
fix(test): ctest unable to find executable
1 parent 24fa8ae commit 0061e24

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

build.bat

+1-3
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,8 @@ cmake --build %build_dir% --config %build_config% --target install
200200
if errorlevel 1 goto error
201201

202202
if "%build_test%" == "ON" (
203-
pushd %build_dir%
204-
ctest --output-on-failure
203+
ctest --test-dir %build_dir% -C %build_config% --output-on-failure
205204
if errorlevel 1 goto error
206-
popd
207205
)
208206

209207
echo.

test/CMakeLists.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ endif(BUILD_SHARED_LIBS)
1313
file(GLOB test_data_files ${PROJECT_SOURCE_DIR}/data/test/*.yaml)
1414
file(COPY ${test_data_files} DESTINATION ${EXECUTABLE_OUTPUT_PATH})
1515

16-
set(rime_test_executable ${EXECUTABLE_OUTPUT_PATH}/rime_test${ext})
17-
add_test(rime_test ${rime_test_executable})
16+
add_test(NAME rime_test
17+
COMMAND rime_test
18+
WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})

0 commit comments

Comments
 (0)