From 04b6c407bcddddaa3b5e1f376d6ad84cc465d07f Mon Sep 17 00:00:00 2001 From: mpv Date: Fri, 3 Mar 2017 11:51:13 +0300 Subject: [PATCH] A script for generation of extended coverage reports with splitting different packages reports into sub-directories --- lcov-run.sh | 13 -------- lcov_reports.sh | 79 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 13 deletions(-) delete mode 100755 lcov-run.sh create mode 100644 lcov_reports.sh diff --git a/lcov-run.sh b/lcov-run.sh deleted file mode 100755 index b1a0c5f82..000000000 --- a/lcov-run.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -source env.sh -source ${TOOLS_DIR}/env_linux.sh - -export GCOV_DIR=${GCOV_DIR:-${BUILD_DIR}} - -echo "Collect coverage data..." -lcov --capture --directory ${GCOV_DIR} --output-file coverage.info - -echo "Generate HTML for coverage data..." -genhtml coverage.info --output-directory ${1:-lcov_html} - diff --git a/lcov_reports.sh b/lcov_reports.sh new file mode 100644 index 000000000..ff376c922 --- /dev/null +++ b/lcov_reports.sh @@ -0,0 +1,79 @@ +#!/bin/bash -ex + +source env.sh + +cd ${BUILD_DIR} + +lcov --capture --directory /data/mpv/build --no-external --base-directory=/data/mpv/sources --output-file coverage.info.noext -q + +# make a working copy of report +cp -f coverage.info.noext covfile +# remove all reports of GUI and external parts (for all the next kinds of reports) +for MASK in '*wrap*' 'moc_*' 'XAO_*' 'SketcherPrs_*' 'GeomAlgoImpl_*' 'ModuleBase_*' 'Primitives*' '*Widget*' '*Splitter*'; do +lcov -r covfile ${MASK} --output-file covfile_res -q +mv -f covfile_res covfile +done + + +# prepare API report +cp -f covfile covAPI +# remove plugins +for MASK in 'Build' 'Collection' 'Construction' 'Exchange' 'Features' 'GDML' 'Initialization' 'Parameters' 'PartSet' 'Sketch'; do +lcov -r covAPI *${MASK}Plugin* --output-file covAPI_res -q +mv -f covAPI_res covAPI +done +# remove low level API +for MASK in 'GDML' 'Geom' 'GeomAlgo' 'GeomData' 'Model'; do +lcov -r covAPI *${MASK}API* --output-file covAPI_res -q +mv -f covAPI_res covAPI +done +# remove others +for MASK in 'Config' 'Events' 'GeomData' 'GeomValidators' 'Model_' 'ModelGeomAlgo' 'SketchSolver'; do +lcov -r covAPI *${MASK}* --output-file covAPI_res -q +mv -f covAPI_res covAPI +done +rm -rf lcov_htmlAPI +genhtml covAPI --output-directory lcov_htmlAPI -q + + +# prepare Direct report +cp -f covfile covDirect +# remove plugins +for MASK in 'Build' 'Collection' 'Construction' 'Exchange' 'Features' 'GDML' 'Initialization' 'Parameters' 'PartSet' 'Sketch'; do +str=$startmask$MASK$endmask +lcov -r covDirect *${MASK}Plugin* --output-file covDirect_res -q +mv -f covDirect_res covDirect +done +# remove low level API +for MASK in 'GDML' 'Builder' 'Collection' 'Connector' 'Construction' 'Model' 'Exchange' 'Features' 'ModelHigh' 'Parameters' 'PartSet' 'Sketch' 'Build' 'GeomData'; do +lcov -r covDirect *${MASK}API* --output-file covDirect_res -q +mv -f covDirect_res covDirect +done +# remove others +for MASK in 'Config' 'Events' 'GeomValidators' 'Model_' 'ModelGeomAlgo' 'SketchSolver' 'GeomData'; do +lcov -r covDirect *${MASK}* --output-file covDirect_res -q +mv -f covDirect_res covDirect +done +rm -rf lcov_htmlDirect +genhtml covDirect --output-directory lcov_htmlDirect -q + + +# prepare Else report +cp -f covfile covElse +# remove plugins +for MASK in 'GDML'; do +str=$startmask$MASK$endmask +lcov -r covElse *${MASK}Plugin* --output-file covElse_res -q +mv -f covElse_res covElse +done +# remove low level API +for MASK in 'Geom' 'GeomAlgo' 'GDML' 'Builder' 'Collection' 'Connector' 'Construction' 'Exchange' 'Features' 'ModelHigh' 'Parameters' 'PartSet' 'Sketch' 'Build'; do +lcov -r covElse *${MASK}API* --output-file covElse_res -q +mv -f covElse_res covElse +done +rm -rf lcov_htmlElse +genhtml covElse --output-directory lcov_htmlElse -q + + +# go back +cd ${SOURCES_DIR} -- 2.39.2