3 # This script can be used to generate the code coverage report.
4 # Important: the library needs to be compiled in debug mode and with coverage option
5 # add to configure options:
6 # CXXFLAGS="-fprofile-arcs -ftest-coverage"
7 # CFLAGS="-fprofile-arcs -ftest-coverage"
10 # > cd BUILD/GEOM/src/XAO
14 # > cp ../.libs/*.gcno .
16 # > cp ../.libs/*.gcda .
17 # > ./coverage_report XAO
22 # browser to open the report
24 # name for the info file
28 if [[ $TITLE == "--reset" ]]
30 lcov --base-directory . --directory . --zerocounters -q
38 echo $TITLE "name is required"
42 INFO_FILE=${TITLE}.info
48 # collecte des données
49 lcov --directory . --capture --output-file $INFO_FILE
51 # suppression des symboles externes
52 lcov --remove $INFO_FILE "/usr*" -o $INFO_FILE $QUIET
54 lcov --remove $INFO_FILE "/home2/*" -o $INFO_FILE $QUIET
56 # suppression des tests
57 lcov --remove $INFO_FILE "*/tests/*" -o $INFO_FILE $QUIET
59 # génération du rapport
60 genhtml --output-directory $REPORT_PATH --title $TITLE --num-spaces 4 $INFO_FILE
64 $BROWSER $REPORT_PATH/index.html &