Skip to content

Commit 371cd9a

Browse files
committed
chore: update brush pipeline by running test with ctest
1 parent e92ee7a commit 371cd9a

2 files changed

Lines changed: 17 additions & 14 deletions

File tree

.github/workflows/scriptorium-ime-brush-platform-ci.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v4
2424

25-
- name: Configure Git for Private Modules
26-
shell: bash
27-
env:
28-
TOKEN: ${{ secrets.ORG_READER_TOKEN }}
29-
run: |
30-
git config --global url."https://${TOKEN}@github.com/".insteadOf "https://github.com/"
31-
3225
- name: Configure CMake
3326
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
3427
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
@@ -42,4 +35,4 @@ jobs:
4235
working-directory: ${{github.workspace}}/build
4336
# Execute tests defined by the CMake configuration.
4437
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
45-
run: .\tests\unit_tests\${{env.BUILD_TYPE}}\scriptorium_brush_unit_tests.exe --gtest_shuffle
38+
run: ctest --test-dir ${{ github.workspace }}/build -C ${{ env.BUILD_TYPE }} --schedule-random --output-on-failure

tests/unit_tests/CMakeLists.txt

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,32 @@ add_executable(scriptorium_brush_unit_tests
22
infra/tsf/dll_main_test.cpp
33
)
44

5-
target_include_directories(scriptorium_brush_unit_tests PRIVATE ${CMAKE_SOURCE_DIR}/tests/unit_tests/include)
5+
target_include_directories(scriptorium_brush_unit_tests PRIVATE
6+
${CMAKE_SOURCE_DIR}/tests/unit_tests/include
7+
)
68

79
target_link_libraries(scriptorium_brush_unit_tests PRIVATE
810
scriptorium::felt::core::protocol
911
scriptorium::felt::core::ipc
1012
scriptorium::felt::core::logger
1113
scriptorium::brush::tsf
1214
scriptorium::brush
13-
gtest_main
14-
gmock_main
15+
GTest::gtest_main
16+
GTest::gmock
1517
Advapi32
1618
)
1719

18-
target_compile_definitions(scriptorium_brush_unit_tests PRIVATE PROJECT_SOURCE_DIR="${CMAKE_SOURCE_DIR}")
20+
target_compile_definitions(scriptorium_brush_unit_tests PRIVATE
21+
PROJECT_SOURCE_DIR="${CMAKE_SOURCE_DIR}"
22+
)
1923

20-
add_custom_command(TARGET scriptorium_brush_unit_tests POST_BUILD
24+
add_custom_command(
25+
TARGET scriptorium_brush_unit_tests
26+
POST_BUILD
2127
COMMAND ${CMAKE_COMMAND} -E copy_if_different
22-
"${CMAKE_BINARY_DIR}/ScriptoriumLabIME/${CMAKE_CFG_INTDIR}/scriptorium-brush.dll" $<TARGET_FILE_DIR:scriptorium_brush_unit_tests>
28+
"${CMAKE_BINARY_DIR}/ScriptoriumLabIME/${CMAKE_CFG_INTDIR}/scriptorium-brush.dll"
29+
$<TARGET_FILE_DIR:scriptorium_brush_unit_tests>
2330
)
31+
32+
include(GoogleTest)
33+
gtest_discover_tests(scriptorium_brush_unit_tests)

0 commit comments

Comments
 (0)