]> git.donarmstrong.com Git - lilypond.git/blob - buildscripts/build-coverage.sh
We are using git, not CVS...
[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 mkdir -p scripts/out-cov/
22 touch scripts/out-cov/midi2ly scripts/out-cov/midi2ly.1
23 make conf=cov -j2 &&  \
24   make conf=cov test-clean OUT_TEST=testcov LILYPOND_JOBS= && \
25   make conf=cov test OUT_TEST=testcov LILYPOND_JOBS='-dtrace-scheme-coverage '
26
27 if test "$?" != "0"; then
28   tail -100 out-cov/test-run.log
29   exit 1
30 fi
31
32 depth=../..
33 resultdir=out/coverage-results
34
35 rm -rf $resultdir
36 mkdir $resultdir
37 cd $resultdir
38
39 ln $depth/lily/* .
40 ln $depth/scm/*.scm .
41 mv $depth/input/regression/out-testcov/*.scm.cov .
42 ln $depth/ly/*.ly .
43 ln $depth/lily/out-cov/*[ch] .
44 mkdir include
45 ln $depth/lily/include/* include/
46 ln $depth/flower/include/* include/
47 for a in *[cl] *.yy
48 do
49    gcov -o $depth/lily/out-cov/  -p $a > $a.gcov-summary
50 done 
51
52 python $depth/buildscripts/coverage.py --uncovered *.cc > uncovered.txt
53 python $depth/buildscripts/coverage.py --hotspots *.cc > hotspots.txt
54 python $depth/buildscripts/coverage.py --summary *.cc > summary.txt
55 python $depth/buildscripts/coverage.py --uncovered *.scm > uncovered-scheme.txt
56
57 head -20 summary.txt
58
59 cat <<EOF
60 results in
61
62   out/coverage-results/summary.txt
63   out/coverage-results/uncovered.txt
64   out/coverage-results/uncovered-scheme.txt
65   out/coverage-results/hotspots.txt
66
67 EOF