-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlcov_reports.sh
executable file
·71 lines (60 loc) · 2.84 KB
/
lcov_reports.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash -ex
source env.sh
cd ${BUILD_DIR}
lcov --capture --directory ${BUILD_DIR} --no-external --base-directory ${SOURCES_DIR} --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_*' '*Widget*' '*Splitter*'; do
lcov -r covfile ${MASK} --output-file covfile_res -q
mv -f covfile_res covfile
done
ALL='BuildPlugin CollectionPlugin ConstructionPlugin ExchangePlugin FiltersPlugin FeaturesPlugin GDMLPlugin PrimitivesPlugin InitializationPlugin ParametersPlugin PartSetPlugin SketchPlugin'
ALL+=' GDMLAPI PrimitivesAPI BuilderAPI CollectionAPI ConnectorAPI ConstructionAPI ModelAPI ExchangeAPI FiltersAPI FeaturesAPI ModelHighAPI ParametersAPI PartSetAPI SketchAPI BuildAPI GeomDataAPI GeomAPI GeomAlgoAPI'
ALL+=' Config Events GeomValidators Model_ ModelGeomAlgo Selector SketchSolver GeomData'
# prepare API report
cp -f covfile covAPI
# remove all plugins data except the needed
NEED='BuildAPI CollectionAPI ConnectorAPI ConstructionAPI ExchangeAPI FiltersAPI FeaturesAPI ModelHighAPI ParametersAPI PartSetAPI PrimitivesAPI SketchAPI'
for MASK in $ALL; do
if ! [[ " $NEED " =~ " $MASK " ]]; then
lcov -r covAPI *${MASK}* --output-file covAPI_res -q
mv -f covAPI_res covAPI
fi
done
rm -rf lcov_htmlAPI
genhtml covAPI --output-directory lcov_htmlAPI -q
# prepare Direct report
cp -f covfile covDirect
# remove all plugins data except the needed
NEED='GeomAlgoAPI GeomAPI'
for MASK in $ALL; do
if ! [[ " $NEED " =~ " $MASK " ]]; then
lcov -r covDirect *${MASK}* --output-file covDirect_res -q
mv -f covDirect_res covDirect
fi
done
# exclude GeomAPI_AISObject as GUI-related object
lcov -r covDirect GeomAPI_AISObject* --output-file covDirect_res -q
mv -f covDirect_res covDirect
# exclude coverage of algorithms related to GDML plugin
lcov -r covDirect GeomAlgoAPI_ConeSegment* --output-file covDirect_res -q
mv -f covDirect_res covDirect
lcov -r covDirect GeomAlgoAPI_Ellipsoid* --output-file covDirect_res -q
mv -f covDirect_res covDirect
rm -rf lcov_htmlDirect
genhtml covDirect --output-directory lcov_htmlDirect -q
# prepare Else report
cp -f covfile covElse
# remove all plugins data except the needed
NEED='BuildPlugin CollectionPlugin Config ConstructionPlugin Events ExchangePlugin FiltersPlugin FeaturesPlugin GeomData GeomDataAPI GeomValidators InitializationPlugin Model_ ModelAPI ModelGeomAlgo ParametersPlugin PartSetPlugin PrimitivesPlugin Selector SketchPlugin SketchSolver'
for MASK in $ALL; do
if ! [[ " $NEED " =~ " $MASK " ]]; then
lcov -r covElse *${MASK}* --output-file covElse_res -q
mv -f covElse_res covElse
fi
done
rm -rf lcov_htmlElse
genhtml covElse --output-directory lcov_htmlElse -q
# go back
cd ${SOURCES_DIR}