Salome HOME
Update code coverage script to use relative paths for BUILD and SOURCES directories
[modules/shaper.git] / lcov_reports.sh
1 #!/bin/bash -ex
2
3 source env.sh
4
5 cd ${BUILD_DIR}
6
7 lcov --capture --directory ${BUILD_DIR} --no-external --base-directory ${SOURCES_DIR} --output-file coverage.info.noext -q
8
9 # make a working copy of report
10 cp -f coverage.info.noext covfile
11 # remove all reports of GUI and external parts (for all the next kinds of reports)
12 for MASK in '*wrap*' 'moc_*' 'XAO_*' 'SketcherPrs_*' 'GeomAlgoImpl_*' 'ModuleBase_*' '*Widget*' '*Splitter*'; do
13 lcov -r covfile ${MASK} --output-file covfile_res -q
14 mv -f covfile_res covfile
15 done
16
17
18 # prepare API report
19 cp -f covfile covAPI
20 # remove plugins
21 for MASK in 'Build' 'Collection' 'Construction' 'Exchange' 'Features' 'GDML' 'Primitives' 'Initialization' 'Parameters' 'PartSet' 'Sketch'; do
22 lcov -r covAPI *${MASK}Plugin* --output-file covAPI_res -q
23 mv -f covAPI_res covAPI
24 done
25 # remove low level API
26 for MASK in 'Geom' 'GeomAlgo' 'GeomData' 'Model'; do
27 lcov -r covAPI *${MASK}API* --output-file covAPI_res -q
28 mv -f covAPI_res covAPI
29 done
30 # remove others
31 for MASK in 'Config' 'Events' 'GeomData' 'GeomValidators' 'Model_' 'ModelGeomAlgo' 'SketchSolver'; do
32 lcov -r covAPI *${MASK}* --output-file covAPI_res -q
33 mv -f covAPI_res covAPI
34 done
35 rm -rf lcov_htmlAPI
36 genhtml covAPI --output-directory lcov_htmlAPI -q
37
38
39 # prepare Direct report
40 cp -f covfile covDirect
41 # remove plugins
42 for MASK in 'Build' 'Collection' 'Construction' 'Exchange' 'Features' 'GDML' 'Primitives' 'Initialization' 'Parameters' 'PartSet' 'Sketch'; do
43 str=$startmask$MASK$endmask
44 lcov -r covDirect *${MASK}Plugin* --output-file covDirect_res -q
45 mv -f covDirect_res covDirect
46 done
47 # remove low level API
48 for MASK in 'GDML' 'Primitives' 'Builder' 'Collection' 'Connector' 'Construction' 'Model' 'Exchange' 'Features' 'ModelHigh' 'Parameters' 'PartSet' 'Sketch' 'Build' 'GeomData'; do
49 lcov -r covDirect *${MASK}API* --output-file covDirect_res -q
50 mv -f covDirect_res covDirect
51 done
52 # remove others
53 for MASK in 'Config' 'Events' 'GeomValidators' 'Model_' 'ModelGeomAlgo' 'SketchSolver' 'GeomData'; do
54 lcov -r covDirect *${MASK}* --output-file covDirect_res -q
55 mv -f covDirect_res covDirect
56 done
57 rm -rf lcov_htmlDirect
58 genhtml covDirect --output-directory lcov_htmlDirect -q
59
60
61 # prepare Else report
62 cp -f covfile covElse
63 # remove low level API
64 for MASK in 'Geom' 'GeomAlgo' 'GDML' 'Primitives' 'Builder' 'Collection' 'Connector' 'Construction' 'Exchange' 'Features' 'ModelHigh' 'Parameters' 'PartSet' 'Sketch' 'Build'; do
65 lcov -r covElse *${MASK}API* --output-file covElse_res -q
66 mv -f covElse_res covElse
67 done
68 rm -rf lcov_htmlElse
69 genhtml covElse --output-directory lcov_htmlElse -q
70
71
72 # go back
73 cd ${SOURCES_DIR}