Salome HOME
Suppress Test checkPythonDump for macro feature
[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 # RefAttrList is unused type of attribute for now
13 for MASK in '*wrap*' 'moc_*' 'XAO_*' 'SketcherPrs_*' 'GeomAlgoImpl_*' 'ModuleBase_*' '*Widget*' '*Splitter*' '*RefAttrList*'; do
14 lcov -r covfile ${MASK} --output-file covfile_res -q
15 mv -f covfile_res covfile
16 done
17
18 ALL='BuildPlugin CollectionPlugin ConstructionPlugin ExchangePlugin FiltersPlugin FeaturesPlugin GDMLPlugin PrimitivesPlugin InitializationPlugin ParametersPlugin PartSetPlugin SketchPlugin'
19 ALL+=' GDMLAPI PrimitivesAPI BuilderAPI CollectionAPI ConnectorAPI ConstructionAPI ModelAPI ExchangeAPI FiltersAPI FeaturesAPI ModelHighAPI ParametersAPI PartSetAPI SketchAPI BuildAPI GeomDataAPI GeomAPI GeomAlgoAPI'
20 ALL+=' Config Events GeomValidators Model_ ModelGeomAlgo Selector SketchSolver GeomData'
21
22 # prepare API report
23 cp -f covfile covAPI
24 # remove all plugins data except the needed
25 NEED='BuildAPI CollectionAPI ConnectorAPI ConstructionAPI ExchangeAPI FiltersAPI FeaturesAPI ModelHighAPI ParametersAPI PartSetAPI PrimitivesAPI SketchAPI'
26 for MASK in $ALL; do
27   if ! [[ " $NEED " =~ " $MASK " ]]; then
28     lcov -r covAPI *${MASK}* --output-file covAPI_res -q
29     mv -f covAPI_res covAPI
30   fi
31 done
32 rm -rf lcov_htmlAPI
33 genhtml covAPI --output-directory lcov_htmlAPI -q
34
35
36 # prepare Direct report
37 cp -f covfile covDirect
38 # remove all plugins data except the needed
39 NEED='GeomAlgoAPI GeomAPI'
40 for MASK in $ALL; do
41   if ! [[ " $NEED " =~ " $MASK " ]]; then
42     lcov -r covDirect *${MASK}* --output-file covDirect_res -q
43     mv -f covDirect_res covDirect
44   fi
45 done
46 # exclude GeomAPI_AISObject as GUI-related object
47 lcov -r covDirect GeomAPI_AISObject* --output-file covDirect_res -q
48 mv -f covDirect_res covDirect
49 # exclude coverage of algorithms related to GDML plugin
50 lcov -r covDirect GeomAlgoAPI_ConeSegment* --output-file covDirect_res -q
51 mv -f covDirect_res covDirect
52 lcov -r covDirect GeomAlgoAPI_Ellipsoid* --output-file covDirect_res -q
53 mv -f covDirect_res covDirect
54 rm -rf lcov_htmlDirect
55 genhtml covDirect --output-directory lcov_htmlDirect -q
56
57
58 # prepare Else report
59 cp -f covfile covElse
60 # remove all plugins data except the needed
61 NEED='BuildPlugin CollectionPlugin Config ConstructionPlugin Events ExchangePlugin FiltersPlugin FeaturesPlugin GeomData GeomDataAPI GeomValidators InitializationPlugin Model_ ModelAPI ModelGeomAlgo ParametersPlugin PartSetPlugin PrimitivesPlugin Selector SketchPlugin SketchSolver'
62 for MASK in $ALL; do
63   if ! [[ " $NEED " =~ " $MASK " ]]; then
64     lcov -r covElse *${MASK}* --output-file covElse_res -q
65     mv -f covElse_res covElse
66   fi
67 done
68 rm -rf lcov_htmlElse
69 genhtml covElse --output-directory lcov_htmlElse -q
70
71 # go back
72 cd ${SOURCES_DIR}