diff options
author | Andrea Shepard <andrea@torproject.org> | 2013-07-16 06:40:08 -0700 |
---|---|---|
committer | Andrea Shepard <andrea@torproject.org> | 2013-07-16 06:40:08 -0700 |
commit | e5d3efd892f63744be8867fb69e2eb1cb5236438 (patch) | |
tree | 55ff83ff3f04b28fc1b47137e02a43923d57709d /contrib | |
parent | 459d82719348d860d856b8753e07cb4057f692ed (diff) | |
download | tor-e5d3efd892f63744be8867fb69e2eb1cb5236438.tar tor-e5d3efd892f63744be8867fb69e2eb1cb5236438.tar.gz |
Make contrib/coverage smarter about check file-existence edge cases
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/coverage | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/contrib/coverage b/contrib/coverage index 8d971660c..f4ae47582 100755 --- a/contrib/coverage +++ b/contrib/coverage @@ -12,9 +12,35 @@ for fn in src/or/*.c src/common/*.c; do DN=`dirname $fn` F=`echo $BN | sed -e 's/\.c$//;'` GC="${BN}.gcov" - gcov -o $DN/src_*$F.o $fn - if [ -n $dst ] + # Figure out the object file names + ONS=`echo ${DN}/src_*-${F}.o` + ONS_WILDCARD_LITERAL="${DN}/src_*-${F}.o" + # If the wildcard didn't expand, no files + if [ "$ONS" != "${ONS_WILDCARD_LITERAL}" ] then - mv $GC $dst/$GC + for on in $ONS; do + # We should have a gcno file + GCNO=`echo $on | sed -e 's/\.o$/\.gcno/;'` + if [ -e $GCNO ] + then + # No need to test for gcda, since gcov assumes no execution + # if it's absent + rm -f $GC + gcov -o $on $fn + if [ -e $GC ] + then + if [ -n $dst ] + then + mv $GC $dst/$GC + fi + else + echo "gcov -o $on $fn didn't make a .gcov file" + fi + else + echo "Couldn't find gcno file for $on" + fi + done + else + echo "No object file found matching source file $fn" fi done |