Skip to content
Snippets Groups Projects
Commit f382992a authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Improve target building for CI

parent 51d2e1a0
No related branches found
No related tags found
1 merge request!19Feature/ci
...@@ -26,7 +26,6 @@ test:gcc8-seq-dbg: ...@@ -26,7 +26,6 @@ test:gcc8-seq-dbg:
script: script:
- cd build/gcc8-dbg - cd build/gcc8-dbg
- make run_unit_tests - make run_unit_tests
- make coverage
cache: cache:
key: "${CI_COMMIT_REF_SLUG}-gcc8-dbg" key: "${CI_COMMIT_REF_SLUG}-gcc8-dbg"
paths: paths:
......
...@@ -219,6 +219,13 @@ add_subdirectory("${CATCH_MODULE_PATH}") ...@@ -219,6 +219,13 @@ add_subdirectory("${CATCH_MODULE_PATH}")
add_subdirectory(tests) add_subdirectory(tests)
enable_testing() enable_testing()
add_custom_target(run_unit_tests
ALL
COMMAND ${CMAKE_CTEST_COMMAND} -j ${PROCESSOR_COUNT}
DEPENDS unit_tests mpi_unit_tests
COMMENT "Executing unit tests."
)
# unit tests coverage # unit tests coverage
if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage") if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage")
...@@ -244,17 +251,10 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage") ...@@ -244,17 +251,10 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage")
set(GCOVR_OPTIONS --object-directory="${PUGS_BINARY_DIR}" -r "${PUGS_SOURCE_DIR}/src" ${GCOVR_EXCLUDE} ${GCOVR_EXTRA}) set(GCOVR_OPTIONS --object-directory="${PUGS_BINARY_DIR}" -r "${PUGS_SOURCE_DIR}/src" ${GCOVR_EXCLUDE} ${GCOVR_EXTRA})
add_custom_target(run_unit_tests
ALL
COMMAND ${CMAKE_CTEST_COMMAND} -j ${PROCESSOR_COUNT}
DEPENDS unit_tests mpi_unit_tests pugs
COMMENT "Executing unit tests."
)
add_custom_target(coverage add_custom_target(coverage
ALL ALL
COMMAND ${GCOVR} ${GCOVR_OPTIONS} --exclude-unreachable-branches --sort-percentage COMMAND ${GCOVR} ${GCOVR_OPTIONS} --exclude-unreachable-branches --sort-percentage
DEPENDS run_unit_tests DEPENDS run_unit_tests pugs
COMMENT "Running gcovr to build coverage report." COMMENT "Running gcovr to build coverage report."
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment