]> git.donarmstrong.com Git - lilypond.git/blob - buildscripts/build-coverage.sh
put coverage in out/coverage-results
[lilypond.git] / buildscripts / build-coverage.sh
1 #!/bin/sh
2
3 if test "$1" == "--fresh"; then
4   fresh=yes
5 fi
6
7 if test ! -f config-cov.make; then
8   fresh=yes
9 fi
10
11 if test "$fresh" = "yes";
12 then
13   ./configure --enable-config=cov --disable-optimising \
14    &&   make conf=cov -j2 clean \
15    &&   perl -i~ -pe 's/-pipe /-fprofile-arcs -ftest-coverage -pipe /g' config-cov.make \
16    &&   perl -i~ -pe 's/ -ldl / -lgcov -ldl /g' config-cov.make
17 else
18   find -name '*.gcda' -exec rm  '{}' ';'
19 fi
20
21
22 make conf=cov -j2 &&  \
23   make conf=cov test-real-clean LILYPOND_JOBS= && \
24   make conf=cov test LILYPOND_JOBS= 
25
26 if test "$?" != "0"; then
27   tail -100 out-cov/test-run.log
28   exit 1
29 fi
30
31 depth=../..
32 resultdir=out/coverage-results
33
34 rm -rf $resultdir
35 mkdir $resultdir
36 cd $resultdir
37
38 ln $depth/lily/* .
39 ln $depth/lily/out-cov/*[ch] .
40 mkdir include
41 ln $depth/lily/include/* include/
42 for a in *[cl] *.yy
43 do
44    gcov -o $depth/lily/out-cov/  -p $a > $a.gcov-summary
45 done 
46
47 cat <<EOF
48
49 now run 
50
51          python buildscripts/coverage.py --uncovered $resultdir/*.cc
52
53 EOF