Commit 4dd58839 authored by Pierre Aubert's avatar Pierre Aubert
Browse files

Add test

parent 2c23a5f8
Pipeline #99083 passed with stages
in 3 minutes and 58 seconds
image: ctalapp/cta_analysis
image: gitlab-registry.in2p3.fr/cta-lapp/phoenix_libs/phoenix/phoenix_minimal:0.2
stages:
- BuildTestinstall
- DocCoverage
- deploy
#- build
......@@ -9,8 +10,6 @@ stages:
#- deploy
dailyBuildMasterAll:
variables:
CONDA_ENV_DIR: /opt/conda/envs/ctadev
#cache:
#untracked: true
#paths:
......@@ -19,29 +18,53 @@ dailyBuildMasterAll:
stage: BuildTestinstall
script:
- export LD_LIBRARY_PATH=/usr/lib
- source activate ${CONDA_ENV}
- env
- mkdir -p build
- cd build
- >
cmake ..
-DCMAKE_INSTALL_PREFIX=/usr
-DRELEASE_MODE=yes
-DSELF_TESTS_MODE=yes
- make all
- make install
- make test
only:
- branches
- tags
tags:
pages:
variables:
CONDA_ENV_DIR: /opt/conda/envs/ctadev
stage: deploy
TestCoverage:
stage: DocCoverage
script:
- 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:
- export LD_LIBRARY_PATH=/usr/lib
- source activate ${CONDA_ENV}
- env
- rm -fr build public
- mkdir -p build
......@@ -50,7 +73,6 @@ pages:
- >
cmake ..
-DCMAKE_INSTALL_PREFIX=/usr
-DRELEASE_MODE=yes
-DDOC_MODE=yes
- make all
- make doc
......@@ -65,3 +87,15 @@ pages:
tags:
pages:
stage: deploy
script:
- mv coverage public/
artifacts:
paths:
- public
expire_in: 1d
......@@ -18,6 +18,11 @@ install(FILES FindPhoenixCompareFile.cmake DESTINATION share/cmake)
add_subdirectory(src)
if(SELF_TESTS_MODE)
include(CTest)
add_subdirectory(TESTS)
endif(SELF_TESTS_MODE)
set(PHOENIX_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src;${PHOENIX_INCLUDE_DIRS}" CACHE INTERNAL "list of Phoenix include dirs")
......
/** @brief Tool to compare two files together
*
*
*/
project(Phoenix)
cmake_minimum_required(VERSION 3.0)
add_subdirectory(TEST_COMPARE_FILE)
project(Phoenix)
cmake_minimum_required(VERSION 3.0)
add_test(NAME TestCompareFile
COMMAND ${CMAKE_BINARY_DIR}/src/phoenix_comparefile -i Makefile -r Makefile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
......@@ -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(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)
add_subdirectory(doc)
......
/** @mainpage Tool to compare two files together
*
* <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