Commit 5739316b authored by Pierre Aubert's avatar Pierre Aubert
Browse files

Add coverage mode

parent f2a1ac2f
Pipeline #97338 passed with stages
in 20 minutes and 4 seconds
image: ctalapp/cta_analysis image: gitlab-registry.in2p3.fr/cta-lapp/phoenix_libs/phoenix/phoenix_minimal:0.2
stages: stages:
- BuildTestinstall - BuildTestinstall
- DocCoverage
- deploy - deploy
#- build #- build
...@@ -9,8 +10,6 @@ stages: ...@@ -9,8 +10,6 @@ stages:
#- deploy #- deploy
dailyBuildMasterAll: dailyBuildMasterAll:
variables:
CONDA_ENV_DIR: /opt/conda/envs/ctadev
#cache: #cache:
#untracked: true #untracked: true
#paths: #paths:
...@@ -19,29 +18,53 @@ dailyBuildMasterAll: ...@@ -19,29 +18,53 @@ dailyBuildMasterAll:
stage: BuildTestinstall stage: BuildTestinstall
script: script:
- export LD_LIBRARY_PATH=/usr/lib - export LD_LIBRARY_PATH=/usr/lib
- source activate ${CONDA_ENV}
- env - env
- mkdir -p build - mkdir -p build
- cd build - cd build
- > - >
cmake .. cmake ..
-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_PREFIX=/usr
-DRELEASE_MODE=yes
-DSELF_TESTS_MODE=yes -DSELF_TESTS_MODE=yes
- make all - make all
- make install - make install
- make test
only: only:
- branches - branches
- tags - tags
tags: tags:
pages: TestCoverage:
variables: stage: DocCoverage
CONDA_ENV_DIR: /opt/conda/envs/ctadev script:
stage: deploy - export LD_LIBRARY_PATH=/usr/lib
- env
- mkdir -p build coverage
- cd build
- >
cmake ..
-DCMAKE_INSTALL_PREFIX=/usr
-DSELF_TESTS_MODE=yes
-DCMAKE_BUILD_TYPE=Coverage
- make all
- make install
- make test
- make ExperimentalCoverage
- cd ../coverage
- gcovr -r ../ --html cov_report.html --html-details
- gcovr -r ../ --xml Coverage.xml
artifacts:
paths:
- coverage
expire_in: 1d
only:
- branches
- tags
tags:
Doc:
stage: DocCoverage
script: script:
- export LD_LIBRARY_PATH=/usr/lib - export LD_LIBRARY_PATH=/usr/lib
- source activate ${CONDA_ENV}
- env - env
- rm -fr build public - rm -fr build public
- mkdir -p build - mkdir -p build
...@@ -50,7 +73,6 @@ pages: ...@@ -50,7 +73,6 @@ pages:
- > - >
cmake .. cmake ..
-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_PREFIX=/usr
-DRELEASE_MODE=yes
-DDOC_MODE=yes -DDOC_MODE=yes
- make all - make all
- make doc - make doc
...@@ -65,3 +87,15 @@ pages: ...@@ -65,3 +87,15 @@ pages:
tags: tags:
pages:
stage: deploy
script:
- mv coverage public/
artifacts:
paths:
- public
expire_in: 1d
...@@ -28,7 +28,16 @@ function(phoenix_base_project programName programVersion programDescritpion prog ...@@ -28,7 +28,16 @@ function(phoenix_base_project programName programVersion programDescritpion prog
set(CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/cmake CACHE STRING "cmake module path") set(CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/cmake CACHE STRING "cmake module path")
set(PHOENIX_FORCE_PULL_MODULE no CACHE BOOL "Say if the submodule have to be pulled every time or not") set(PHOENIX_FORCE_PULL_MODULE no CACHE BOOL "Say if the submodule have to be pulled every time or not")
add_definitions(--std=c++11 -Wall -Werror -g -O2 -D__PROGRAM_VERSION__="${PROGRAM_VERSION}") if(CMAKE_BUILD_TYPE STREQUAL "Coverage")
message(STATUS "Build for tests COVERAGE")
set(CTEST_COVERAGE_COMMAND "gcov")
set(SELF_TESTS_MODE yes)
set(CMAKE_CXX_FLAGS "--std=c++11 -Wall -Werror -g -O0 -fprofile-arcs -ftest-coverage" PARENT_SCOPE)
else()
set(CMAKE_CXX_FLAGS "--std=c++11 -Wall -Werror -g -O2" PARENT_SCOPE)
endif()
add_definitions(-D__PROGRAM_VERSION__="${PROGRAM_VERSION}")
if(DOC_MODE) if(DOC_MODE)
add_subdirectory(doc) add_subdirectory(doc)
......
/** @mainpage Set of tools to generate code
*
* <a href="coverage/cov_report.html">See test coverage detail from gcovr</a><br />
<a href="coverage/Coverage.xml">See test coverage report</a>
*/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment