po: Update translations from translationproject.org.
[pspp.git] / tests / coverage.sh
blob3a210783c2fed0b507cd50f67c12aa23119c7ee0
1 #!/bin/sh
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
15 TEMPDIR=/tmp/pspp-cov-$$
16 export TEMPDIR
18 mkdir -p $TEMPDIR
20 files=`find src -name '*.c'`
22 summary_file="$TEMPDIR/coverage.txt"
23 export summary_file
25 rm -f $summary_file
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
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).
36 AGGREGATE OUTFILE=*
37 /BREAK=file
38 /COVERAGE=MIN(COVERAGE).
40 SORT CASES BY COVERAGE.
42 LIST /COVERAGE file.
44 FREQUENCIES /COVERAGE
45 /HISTOGRAM
46 /PERCENTILES=25,50,75,90.
48 EOF
50 src/pspp -o pspp.html $TEMPDIR/cov.sps
52 rm -rf $TEMPDIR