Skip to content

Commit

Permalink
build: run ctest to run the test program (rime#731)
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiredPlanck authored and graphemecluster committed Oct 8, 2023
1 parent f6a67fb commit acfef38
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ jobs:
-DBUILD_SHARED_LIBS:BOOL=ON
cmake --build build
cmake --install build
cd build/test && cp ../lib/librime.dll . && ./rime_test
cd build && cp ./lib/librime.dll ./test
ctest --output-on-failure
- name: Create distributable
run: |
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ uninstall-debug:
cmake --build $(build) --target remove

test: release
(cd $(build)/test; ./rime_test)
(cd $(build); ctest --output-on-failure)

test-debug: debug
(cd $(build)/test; ./rime_test)
(cd $(build); ctest --output-on-failure)
5 changes: 2 additions & 3 deletions build-clang.bat
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ if %build_librime% == 1 (
)

if "%build_test%" == "ON" (
copy /y dist\lib\rime.dll build\test
pushd build\test
.\rime_test.exe || exit
pushd build
ctest --output-on-failure
popd
)
9 changes: 2 additions & 7 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,8 @@ cmake --build %build_dir% --config %build_config% --target install
if errorlevel 1 goto error

if "%build_test%" == "ON" (
copy /y dist\lib\rime.dll build\test
pushd build\test
if %CMAKE_GENERATOR% == Ninja (
.\rime_test.exe
) else (
.\Release\rime_test.exe
)
pushd %build_dir%
ctest --output-on-failure
popd
)

Expand Down

0 comments on commit acfef38

Please sign in to comment.