LSR: Update.
[lilypond.git] / buildscripts / build-coverage.sh
blobb86ebaaf521ba5a8cc6af1ca0b1c347b389b99ed
1 #!/bin/sh
3 if test "$1" == "--fresh"; then
4 fresh=yes
5 fi
7 if test ! -f config-cov.make; then
8 fresh=yes
9 fi
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 '{}' ';'
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 '
27 if test "$?" != "0"; then
28 tail -100 out-cov/test-run.log
29 exit 1
32 depth=../..
33 resultdir=out/coverage-results
35 rm -rf $resultdir
36 mkdir $resultdir
37 cd $resultdir
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
49 gcov -o $depth/lily/out-cov/ -p $a > $a.gcov-summary
50 done
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
57 head -20 summary.txt
59 cat <<EOF
60 results in
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
67 EOF