Skip to content

Commit

Permalink
test: improve testing composition
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiredPlanck committed Oct 29, 2023
1 parent 4ba55d0 commit 0fb16eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ jobs:
-DBUILD_SHARED_LIBS:BOOL=ON
cmake --build build
cmake --install build
cd build && cp ./lib/librime.dll ./test
cd build
ctest --output-on-failure
- name: Create distributable
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ if(BUILD_TEST)
find_package(GTest REQUIRED)
if(GTEST_FOUND)
enable_testing()
include_directories(${GTEST_INCLUDE_DIRS})
endif()
endif()

Expand Down
10 changes: 4 additions & 6 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
aux_source_directory(. rime_test_src)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/test)
add_executable(rime_test ${rime_test_src})
target_link_libraries(rime_test
${rime_library}
${rime_dict_library}
${rime_gears_library}
${GTEST_LIBRARIES})
GTest::gtest
GTest::gtest_main)
if(BUILD_SHARED_LIBS)
target_compile_definitions(rime_test PRIVATE RIME_IMPORTS)
endif(BUILD_SHARED_LIBS)

file(GLOB test_data_files ${PROJECT_SOURCE_DIR}/data/test/*.yaml)
file(COPY ${test_data_files} DESTINATION ${EXECUTABLE_OUTPUT_PATH})

add_test(rime_test rime_test)
add_test(NAME rime_test COMMAND rime_test
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/data/test")

0 comments on commit 0fb16eb

Please sign in to comment.