Commit bc3cdf17 authored by PRUVOST Florent's avatar PRUVOST Florent

add analysis script and call it in gitlab-ci

parent d7d3efc5
......@@ -35,29 +35,7 @@ test:
#- scalfmm-cppcheck.xml
- scalfmm-rats.xml
script:
- 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_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
- make -j8 | tee ../scalfmm-build.log
- OMP_NUM_THREADS=8 ctest -V
- cd ..
- lcov --directory . --capture --output-file scalfmm.lcov
- lcov_cobertura.py scalfmm.lcov --output scalfmm-coverage.xml
- export SOURCES_TO_ANALYZE="Examples Src Tests UTests"
#- cppcheck -v -f --language=c++ --platform=unix64 --enable=all --xml --xml-version=2 --suppress=missingIncludeSystem -IBuild/Src ${SOURCES_TO_ANALYZE} 2> scalfmm-cppcheck.xml
- rats -w 3 --xml ${SOURCES_TO_ANALYZE} > scalfmm-rats.xml
- source ./Utils/scripts/analysis.sh
sonar:
stage: sonar
......
#!/bin/bash
# Performs an analysis of ScalFMM source code
# We consider to be in ScalFMM's source code root
# build with proper options
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_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
make -j8 | tee ../scalfmm-build.log
# run tests
OMP_NUM_THREADS=8 ctest -V
cd ..
# capture coverage
lcov --directory . --capture --output-file scalfmm.lcov
lcov_cobertura.py scalfmm.lcov --output scalfmm-coverage.xml
# filter sources:
export SOURCES_TO_ANALYZE="Build/Src/ScalFmmConfig.h Examples Src Tests UTests"
# run cppcheck analysis
# commented for now because too long
# cppcheck -v -f --language=c++ --platform=unix64 --enable=all --xml --xml-version=2 --suppress=missingIncludeSystem -IBuild/Src ${SOURCES_TO_ANALYZE} 2> scalfmm-cppcheck.xml
# run rats analysis
rats -w 3 --xml ${SOURCES_TO_ANALYZE} > scalfmm-rats.xml
# create the sonarqube config file
cat > sonar-project.properties << EOF
sonar.host.url=https://hpclib-sed.bordeaux.inria.fr/sonarqube-dev
sonar.links.homepage=https://gitlab.inria.fr/solverstack/ScalFMM
sonar.links.scm=https://fpruvost@gitlab.inria.fr/solverstack/ScalFMM.git
sonar.links.issue=https://gitlab.inria.fr/solverstack/ScalFMM/issues
sonar.projectKey=scalfmm
sonar.projectName=Scalfmm
sonar.projectDescription=C++ library that implements a kernel independent Fast Multipole Method (LGPL+CeCILL-C)
sonar.projectVersion=devel
sonar.language=c++
sonar.sources=Build/Src/ScalFmmConfig.h, Examples, Src, Tests, UTests
sonar.exclusions=Src/Kernels/FKernelConcepts.hpp, Tests/noDist/PerfTest/TestDriver.hpp
sonar.sourceEncoding=UTF-8
sonar.cxx.compiler.charset=UTF-8
sonar.cxx.compiler.regex=^(.*):(\\d+):\\d+: warning: (.*)\\[(.*)\\]$
sonar.cxx.compiler.reportPath=scalfmm-build.log
sonar.cxx.coverage.reportPath=scalfmm-coverage.xml
#sonar.cxx.cppcheck.reportPath=scalfmm-cppcheck.xml
sonar.cxx.rats.reportPath=scalfmm-rats.xml
EOF
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