Commit f12fd3a8 authored by PRUVOST Florent's avatar PRUVOST Florent

Merge branch 'cppcheck2' into 'develop'

Pipeline and Cppcheck

See merge request solverstack/ScalFMM!12
parents 34bd5f89 f046d04d
...@@ -3,40 +3,77 @@ image: hpclib/scalfmm ...@@ -3,40 +3,77 @@ image: hpclib/scalfmm
stages: stages:
- build - build
- test - test
- sonar
build: build:
stage: build stage: build
artifacts:
name: scalfmm_build
expire_in: 1 day
paths:
- Build/
script: script:
- cd Build && cmake .. - cd Build && cmake ..
-DSCALFMM_USE_LOG=ON -DSCALFMM_USE_LOG=ON
-DSCALFMM_USE_ASSERT=ON -DSCALFMM_USE_ASSERT=ON
-DSCALFMM_USE_SSE=OFF -DSCALFMM_USE_SSE=OFF
-DSCALFMM_USE_AVX=OFF
-DSCALFMM_USE_BLAS=ON -DSCALFMM_USE_BLAS=ON
-DSCALFMM_USE_FFT=ON -DSCALFMM_USE_FFT=ON
-DSCALFMM_USE_MPI=ON -DSCALFMM_USE_MPI=ON
-DSCALFMM_USE_STARPU=ON -DSCALFMM_USE_STARPU=ON
-DSCALFMM_BUILD_EXAMPLES=ON -DSCALFMM_BUILD_EXAMPLES=ON
-DSCALFMM_BUILD_TESTS=OFF -DSCALFMM_BUILD_TESTS=ON
-DSCALFMM_BUILD_UTESTS=OFF -DSCALFMM_BUILD_UTESTS=ON
-DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_VERBOSE_MAKEFILE=ON
-DCMAKE_C_COMPILER=gcc-6 -DCMAKE_C_COMPILER=gcc-6
-DCMAKE_CXX_COMPILER=g++-6 -DCMAKE_CXX_COMPILER=g++-6
- make -j8 - make -j5 2>&1 |tee scalfmm-build.log
doc:
stage: build
artifacts:
name: scalfmm_doc
expire_in: 1 day
paths:
- Build/Doc/html
script:
- cd Build && cmake ..
-DSCALFMM_BUILD_DOC=ON
-DCMAKE_C_COMPILER=gcc-6
-DCMAKE_CXX_COMPILER=g++-6
- make doc
test: test:
stage: test stage: test
dependencies:
- build
artifacts: artifacts:
name: scalfmm_test name: scalfmm_test
expire_in: 1 day expire_in: 1 day
paths:
- Build/
script:
- (cd Build && OMP_NUM_THREADS=4 ctest --no-compress-output -V -j 5 -D ExperimentalBuild -D ExperimentalTest -D ExperimentalCoverage -D ExperimentalSubmit)
sonar:
stage: sonar
dependencies:
- test
artifacts:
name: scalfmm_sonar
expire_in: 1 day
paths: paths:
- scalfmm-build.log - scalfmm-build.log
- scalfmm.lcov
- scalfmm-coverage.xml - scalfmm-coverage.xml
- scalfmm-cppcheck.xml - scalfmm-cppcheck.xml
- scalfmm-rats.xml - scalfmm-rats.xml
- sonar-project.properties - sonar-project.properties
- sonar.log
script: script:
- mv Build/scalfmm-build.log .
- source ./Utils/scripts/analysis.sh - source ./Utils/scripts/analysis.sh
- sonar-scanner |tee sonar.log
- if [[ $CI_REPOSITORY_URL = *"solverstack/ScalFMM"* ]] && [[ $CI_COMMIT_REF_NAME = *"develop"* ]]; then - if [[ $CI_REPOSITORY_URL = *"solverstack/ScalFMM"* ]] && [[ $CI_COMMIT_REF_NAME = *"develop"* ]]; then
sonar-scanner -X 2>&1 |tee sonar.log; sonar-scanner |tee sonar.log;
fi fi
#!/bin/bash #!/bin/bash
# Performs an analysis of ScalFMM source code # Performs an analysis of ScalFMM source code
# We consider to be in ScalFMM's source code root # We consider:
# 1) to be in ScalFMM's source code root
# build with proper options # 2) ScalFMM built into the ./Build directory
cd Build && cmake .. -DSCALFMM_USE_LOG=ON -DSCALFMM_USE_ASSERT=ON -DSCALFMM_USE_SSE=OFF -DSCALFMM_USE_BLAS=ON -DSCALFMM_USE_FFT=ON -DSCALFMM_USE_MPI=ON -DSCALFMM_USE_STARPU=ON -DSCALFMM_BUILD_EXAMPLES=ON -DSCALFMM_BUILD_TESTS=ON -DSCALFMM_BUILD_UTESTS=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_CXX_FLAGS="-O0 -g -fPIC --coverage -Wall -fdiagnostics-show-option -fno-inline" -DCMAKE_EXE_LINKER_FLAGS="--coverage" -DCMAKE_C_COMPILER=gcc-6 -DCMAKE_CXX_COMPILER=g++-6 # 3) ctests with coverage results should have been performed
# make with clang analyzer (failure ...)
#scan-build -plist --intercept-first --analyze-headers -o analyzer_reports make 2>&1 | tee scalfmm-build.log
# ctest : build and run tests + coverage + submit to cdash
OMP_NUM_THREADS=4 ctest --no-compress-output -V -j 5 -D ExperimentalBuild -D ExperimentalTest -D ExperimentalCoverage -D ExperimentalSubmit 2>&1 | tee -a ../scalfmm-build.log
cd ..
# capture coverage # capture coverage
lcov --directory Build --capture --output-file scalfmm.lcov lcov --directory Build --capture --output-file scalfmm.lcov
...@@ -24,8 +19,8 @@ export SOURCES_TO_ANALYZE="Src Examples Tests UTests" ...@@ -24,8 +19,8 @@ export SOURCES_TO_ANALYZE="Src Examples Tests UTests"
# commented for now because too long # commented for now because too long
export CPPCHECK_INCLUDES="-IBuild/Src -ISrc -IContribs" export CPPCHECK_INCLUDES="-IBuild/Src -ISrc -IContribs"
export SOURCES_TO_ANALYZE="Src Examples Tests UTests" export SOURCES_TO_ANALYZE="Src Examples Tests UTests"
export CPPCHECK_UNDEF="-USCALFMM_USE_AVX -USCALFMM_USE_AVX2 -USCALFMM_USE_SSE -USCALFMM_USE_EZTRACE -USCALFMM_BLAS_UPCASE -U__AVXPE_INTEL_COMPILER -U__INTEL_COMPILER -U__MIC__ -U__SSEPE_INTEL_COMPILER -U__SSSE3__ -U__SSSE4_1__ -U_WIN32 -Uming -U_MSC_VER -U__IBMCPP__ -U__PGI -U__SUNPRO_CC -U__clang__" export CPPCHECK_UNDEF="-USCALFMM_USE_AVX -USCALFMM_USE_AVX2 -USCALFMM_USE_SSE -USCALFMM_USE_EZTRACE -USCALFMM_BLAS_NOCHANGE -USCALFMM_BLAS_UPCASE -U__AVXPE_INTEL_COMPILER -U__INTEL_COMPILER -U__MIC__ -U__SSEPE_INTEL_COMPILER -U__SSSE3__ -U__SSSE4_1__ -U_WIN32 -Uming -U_MSC_VER -U__IBMCPP__ -U__PGI -U__SUNPRO_CC -U__clang__ -U__APPLE__ -U__HP_aCC -U__HP_cc -U__ICC"
cppcheck -v -f --language=c++ --platform=unix64 --enable=all --xml --xml-version=2 --suppress=missingIncludeSystem ${CPPCHECK_UNDEF} ${CPPCHECK_INCLUDES} ${SOURCES_TO_ANALYZE} 2> scalfmm-cppcheck.xml cppcheck -v -f --language=c++ --std=c++14 --platform=unix64 --enable=all --xml --xml-version=2 --suppress=missingIncludeSystem ${CPPCHECK_UNDEF} ${CPPCHECK_INCLUDES} ${SOURCES_TO_ANALYZE} 2> scalfmm-cppcheck.xml
# run rats analysis # run rats analysis
rats -w 3 --xml ${SOURCES_TO_ANALYZE} > scalfmm-rats.xml rats -w 3 --xml ${SOURCES_TO_ANALYZE} > scalfmm-rats.xml
......
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