3 # Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 # This script can be used to generate the code coverage report.
23 # Important: the library needs to be compiled in debug mode and with coverage option
24 # add to configure options:
25 # CXXFLAGS="-fprofile-arcs -ftest-coverage"
26 # CFLAGS="-fprofile-arcs -ftest-coverage"
29 # > cd BUILD/GEOM/src/XAO
33 # > cp ../.libs/*.gcno .
35 # > cp ../.libs/*.gcda .
36 # > ./coverage_report XAO
41 # browser to open the report
43 # name for the info file
47 if [[ $TITLE == "--reset" ]]
49 lcov --base-directory . --directory . --zerocounters -q
57 echo $TITLE "name is required"
61 INFO_FILE=${TITLE}.info
67 # collecte des données
68 lcov --directory . --capture --output-file $INFO_FILE
70 # suppression des symboles externes
71 lcov --remove $INFO_FILE "/usr*" -o $INFO_FILE $QUIET
73 lcov --remove $INFO_FILE "/home2/*" -o $INFO_FILE $QUIET
75 # suppression des tests
76 lcov --remove $INFO_FILE "*/tests/*" -o $INFO_FILE $QUIET
78 # génération du rapport
79 genhtml --output-directory $REPORT_PATH --title $TITLE --num-spaces 4 $INFO_FILE
83 $BROWSER $REPORT_PATH/index.html &