Skip to content

Commit ac279b3

Browse files
committed
Separate deployment and fetch test
1 parent 4e67646 commit ac279b3

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

.github/workflows/tests.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,10 @@ jobs:
4545
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
4646

4747
- name: Run tests
48-
run: ctest --output-on-failure --build-config ${{ matrix.build_type }} --test-dir ${{ steps.strings.outputs.build-output-dir }}
48+
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --target test
49+
50+
- name: Run deployment test
51+
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --target test.deploy
52+
53+
- name: Run fetch test
54+
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --target test.fetch

tests/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ foreach(test IN LISTS tests)
2020
gtest_discover_tests(${test})
2121
endforeach()
2222

23-
# Add the deployment test, which checks that we can indeed install traits and then use
23+
# Add the deployment test target, which checks that we can indeed install traits and then use
2424
# `find_package` to depend on it from another CMake project.
25+
2526
include(ExternalProject)
2627
set(FAKE_INSTALL_DIR "${PROJECT_BINARY_DIR}/fakeroot")
2728
ExternalProject_Add(
@@ -47,10 +48,9 @@ add_custom_target(
4748
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}\;${FAKE_INSTALL_DIR}"
4849
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
4950
COMMAND ${CMAKE_COMMAND} --build "${CMAKE_CURRENT_BINARY_DIR}/deploy")
50-
add_test(NAME test.deploy COMMAND ${CMAKE_COMMAND} --build "${PROJECT_BINARY_DIR}" --target
51-
test.deploy)
5251

53-
# Add the fetch test, which checks that we can indeed use fetch content from another CMake project.
52+
# Add the fetch test target, which checks that we can indeed use fetch content to depend on traits
53+
# from another CMake project.
5454

5555
add_custom_target(
5656
test.fetch
@@ -63,8 +63,8 @@ add_custom_target(
6363
-DCMAKE_CXX_COMPILER="${CMAKE_CXX_COMPILER}" -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}"
6464
-DCMAKE_TOOLCHAIN_FILE="${CMAKE_TOOLCHAIN_FILE}"
6565
COMMAND ${CMAKE_COMMAND} --build "${CMAKE_CURRENT_BINARY_DIR}/fetch")
66-
add_test(NAME test.fetch COMMAND ${CMAKE_COMMAND} --build "${PROJECT_BINARY_DIR}" --target
67-
test.fetch)
66+
67+
# Add the coverage target, which generates a coverage report
6868

6969
if(TRAITS_TEST_COVERAGE)
7070
find_program(LCOV lcov REQUIRED)

0 commit comments

Comments
 (0)