Report bootstrapping progress correctly when downloading microdescs
[tor.git] / contrib / coverage
blobf4ae475828019808ec7411b428d68e2d7c99f827
1 #!/bin/sh
2 # Copyright 2013 The Tor Project, Inc.
3 # See LICENSE for licensing information.
5 # coverage -- run gcov on the appropriate set of object files to extract
6 # coverage information.
8 dst=$1
10 for fn in src/or/*.c src/common/*.c; do
11 BN=`basename $fn`
12 DN=`dirname $fn`
13 F=`echo $BN | sed -e 's/\.c$//;'`
14 GC="${BN}.gcov"
15 # Figure out the object file names
16 ONS=`echo ${DN}/src_*-${F}.o`
17 ONS_WILDCARD_LITERAL="${DN}/src_*-${F}.o"
18 # If the wildcard didn't expand, no files
19 if [ "$ONS" != "${ONS_WILDCARD_LITERAL}" ]
20 then
21 for on in $ONS; do
22 # We should have a gcno file
23 GCNO=`echo $on | sed -e 's/\.o$/\.gcno/;'`
24 if [ -e $GCNO ]
25 then
26 # No need to test for gcda, since gcov assumes no execution
27 # if it's absent
28 rm -f $GC
29 gcov -o $on $fn
30 if [ -e $GC ]
31 then
32 if [ -n $dst ]
33 then
34 mv $GC $dst/$GC
36 else
37 echo "gcov -o $on $fn didn't make a .gcov file"
39 else
40 echo "Couldn't find gcno file for $on"
42 done
43 else
44 echo "No object file found matching source file $fn"
46 done