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