Skip to content

Commit

Permalink
added build targets for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
turleypol committed Dec 12, 2020
1 parent 2ebcde9 commit b460a26
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,17 @@ jobs:
if: matrix.config.nopch == 0
run: |
cd bin-build
ctest -j2 --output-on-failure --repeat-until-fail 2 -C ${{ matrix.config.build-type }} -R escript_
cmake --build . --config ${{ matrix.config.build-type }} --target test_escript
- name: Test (Shard Fixtures)
if: matrix.config.nopch == 0
run: |
cd bin-build
ctest -j2 --output-on-failure -C ${{ matrix.config.build-type }} -E "(escript_|shard_test$)"
cmake --build . --config ${{ matrix.config.build-type }} --target test_pol_fixture
- name: Test (Shard)
if: matrix.config.nopch == 0
run: |
cd bin-build
ctest --verbose -C ${{ matrix.config.build-type }} -R shard_test$ -FA .*
cmake --build . --config ${{ matrix.config.build-type }} --target test_pol_only
- name: Upload shard test log
if: matrix.config.nopch == 0
uses: actions/upload-artifact@v1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/buildmacos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ jobs:
- name: Test (EScript)
run: |
cd bin-build
ctest -j2 --output-on-failure --repeat-until-fail 2 -C ${{ matrix.config.build-type }} -R escript_
cmake --build . --config ${{ matrix.config.build-type }} --target test_escript
- name: Test (Shard Fixtures)
run: |
cd bin-build
ctest -j2 --output-on-failure -C ${{ matrix.config.build-type }} -E "(escript_|shard_test$)"
cmake --build . --config ${{ matrix.config.build-type }} --target test_pol_fixture
- name: Test (Shard)
run: |
cd bin-build
ctest --verbose -C ${{ matrix.config.build-type }} -R shard_test$ -FA .*
cmake --build . --config ${{ matrix.config.build-type }} --target test_pol_only
- name: Upload shard test log
uses: actions/upload-artifact@v1
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ jobs:
- name: Test (EScript)
run: |
cd bin-build
ctest -j2 --output-on-failure -C ${{ matrix.config.build-type }} -R escript_
cmake --build . --config ${{ matrix.config.build-type }} --target test_escript
- name: Test (Shard Fixtures)
run: |
cd bin-build
ctest -j2 --output-on-failure -C ${{ matrix.config.build-type }} -E "(escript_|shard_test$)"
cmake --build . --config ${{ matrix.config.build-type }} --target test_pol_fixture
- name: Test (Shard)
run: |
cd bin-build
ctest --verbose -C ${{ matrix.config.build-type }} -R shard_test$ -FA .*
cmake --build . --config ${{ matrix.config.build-type }} --target test_pol_only
- name: Coverage
run: |
cd bin-build
Expand Down
45 changes: 45 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,48 @@ else()
message("Git or clang-format not found for target 'clang_format'")
endif()

message("adding test targets")
message(" test_escript")
add_custom_target(test_escript
COMMAND ${CMAKE_CTEST_COMMAND}
-j2 --output-on-failure -R escript_ -C ${CMAKE_BUILD_TYPE}
COMMENT "Run escript tests"
VERBATIM
USES_TERMINAL
)
set_target_properties(test_escript PROPERTIES EXCLUDE_FROM_ALL TRUE)
set_target_properties(test_escript PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
set_target_properties(test_escript PROPERTIES FOLDER !BuildTargets)
message(" test_pol")
add_custom_target(test_pol
COMMAND ${CMAKE_CTEST_COMMAND}
-j2 --output-on-failure -E escript_ -C ${CMAKE_BUILD_TYPE}
COMMENT "Run pol tests"
VERBATIM
USES_TERMINAL
)
set_target_properties(test_pol PROPERTIES EXCLUDE_FROM_ALL TRUE)
set_target_properties(test_pol PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
set_target_properties(test_pol PROPERTIES FOLDER !BuildTargets)
message(" test_pol_fixture")
add_custom_target(test_pol_fixture
COMMAND ${CMAKE_CTEST_COMMAND}
-j2 --output-on-failure -E "(escript_|shard_test$)" -C ${CMAKE_BUILD_TYPE}
COMMENT "Run pol fixture tests"
VERBATIM
USES_TERMINAL
)
set_target_properties(test_pol_fixture PROPERTIES EXCLUDE_FROM_ALL TRUE)
set_target_properties(test_pol_fixture PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
set_target_properties(test_pol_fixture PROPERTIES FOLDER !BuildTargets)
message(" test_pol_only")
add_custom_target(test_pol_only
COMMAND ${CMAKE_CTEST_COMMAND}
--verbose -R shard_test$ -FA .* -C ${CMAKE_BUILD_TYPE}
COMMENT "Run pol only tests"
VERBATIM
USES_TERMINAL
)
set_target_properties(test_pol_only PROPERTIES EXCLUDE_FROM_ALL TRUE)
set_target_properties(test_pol_only PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
set_target_properties(test_pol_only PROPERTIES FOLDER !BuildTargets)

0 comments on commit b460a26

Please sign in to comment.