Fix missing @clicksequence problem with older Texinfo versions.
[pspp-builds.git] / tests / coverage.sh
1 #!/bin/sh
2
3 # This little script can be used in conjunction with gcov to see how well 
4 # the regression test suite is covering the PSPP code.
5
6 # To use it: 
7
8 # make distclean
9 # CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
10 # export CFLAGS
11 # ./configure
12 # make check
13 # tests/coverage.sh
14
15 TEMPDIR=/tmp/pspp-cov-$$
16 export TEMPDIR
17
18 mkdir -p $TEMPDIR
19
20 files=`find src -name '*.c'`
21
22 summary_file="$TEMPDIR/coverage.txt"
23 export summary_file
24
25 rm -f $summary_file
26
27 for f in $files ; do 
28         dir=`dirname $f`
29         gcov -p -l -n -o $dir $f  | grep -v '^Creat' >> $summary_file
30 done
31
32 cat  > "$TEMPDIR/cov.sps" << EOF 
33 DATA LIST  FREE  FILE='$summary_file' /COVERAGE (PCT8) d1 (a2) lines *  d2 (a10) d3 (a10) d4 (a10) d5 (a10) file (a25).
34
35
36 AGGREGATE OUTFILE=*
37         /BREAK=file
38         /COVERAGE=MIN(COVERAGE).
39
40 SORT CASES BY COVERAGE.
41
42 LIST /COVERAGE file.
43
44 FREQUENCIES /COVERAGE
45   /HISTOGRAM
46   /PERCENTILES=25,50,75,90.
47
48 EOF
49
50 src/pspp -o html $TEMPDIR/cov.sps
51
52 rm -rf $TEMPDIR