Browse Source

Add optional target directory parameter to coverage script and add reset-gcov target to Makefile.am

Andrea Shepard 10 years ago
parent
commit
d1059a9366
3 changed files with 14 additions and 0 deletions
  1. 3 0
      Makefile.am
  2. 4 0
      changes/bug9267
  3. 7 0
      contrib/coverage

+ 3 - 0
Makefile.am

@@ -71,6 +71,9 @@ test: all
 test-network: all
 	./src/test/test-network.sh
 
+reset-gcov:
+	rm -f src/*/*.gcda
+
 # Avoid strlcpy.c, strlcat.c, aes.c, OpenBSD_malloc_Linux.c, sha256.c,
 # eventdns.[hc], tinytest*.[ch]
 check-spaces:

+ 4 - 0
changes/bug9267

@@ -0,0 +1,4 @@
+  o Minor bugfixes:
+    - Added optional parameter to contrib/coverage script to specify directory
+      to put gcov files in, and added reset-gcov target to top-level makefile.
+      Fixes bug #9267.

+ 7 - 0
contrib/coverage

@@ -5,9 +5,16 @@
 # coverage -- run gcov on the appropriate set of object files to extract
 # coverage information.
 
+dst=$1
+
 for fn in src/or/*.c src/common/*.c; do
     BN=`basename $fn`
     DN=`dirname $fn`
     F=`echo $BN | sed -e 's/\.c$//;'`
+    GC="${BN}.gcov"
     gcov -o $DN/src_*$F.o $fn
+    if [ -n $dst ]
+    then
+      mv $GC $dst/$GC
+    fi
 done