Commit 7d8468e0 authored by Guillaume Pasero's avatar Guillaume Pasero

CI: use a wrapper script to generate coverage report

parent 5b750421
Pipeline #2128 passed with stages
in 52 minutes and 59 seconds
...@@ -227,7 +227,7 @@ ubuntu-xdk-qa-code-coverage: ...@@ -227,7 +227,7 @@ ubuntu-xdk-qa-code-coverage:
ctest -V -S CI/main_qa.cmake ctest -V -S CI/main_qa.cmake
-DIMAGE_NAME:string=ubuntu-18.04-llvm-qa -DIMAGE_NAME:string=ubuntu-18.04-llvm-qa
-DQA:BOOL=ON -DQA:BOOL=ON
- gcovr -x -o build/coverage_report.xml -r . --gcov-executable="llvm-cov gcov" build - ./CI/otb_coverage.sh
- saxon-xslt -o build/ctest_report.xml - saxon-xslt -o build/ctest_report.xml
build/Testing/`head -n 1 build/Testing/TAG`/Test.xml build/Testing/`head -n 1 build/Testing/TAG`/Test.xml
CI/ctest2junit.xsl CI/ctest2junit.xsl
......
#!/bin/bash
# usage : call CI/otb_coverage.sh from source dir
OTB_DIR="$(dirname $0)/.."
OTB_DIR="$(readlink -f $OTB_DIR)"
if [ -z "$BUILD_DIR" ]; then
BUILD_DIR=${OTB_DIR}/build
fi
cd $BUILD_DIR
mkdir cov_filter
echo Generating gcov reports in $BUILD_DIR ...
find $BUILD_DIR -name "*.gcda" -exec llvm-cov gcov -p '{}' > /dev/null \;
find . -maxdepth 1 -regex '.*#Modules#[a-zA-Z0-9]+#[a-zA-Z0-9]+#\(include\|src\|app\)#.*\.gcov' -exec mv '{}' cov_filter \;
rm *.gcov
cd $OTB_DIR
echo Filtered $(ls $BUILD_DIR/cov_filter | wc -l) gcov reports
echo Generating $BUILD_DIR/coverage_report.xml ...
gcovr -r $OTB_DIR -x -g --object-directory=$BUILD_DIR/cov_filter > $BUILD_DIR/coverage_report.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