summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Shepard <andrea@torproject.org>2013-07-15 22:33:39 -0700
committerAndrea Shepard <andrea@torproject.org>2013-07-15 22:33:39 -0700
commitd1059a936644f1a3c274f97218c7224622f212df (patch)
tree0877a94701abd72d5c93b921039be00f9c18c640
parent55f5caf0963935bebb41ded66416c730c3598cb2 (diff)
downloadtor-d1059a936644f1a3c274f97218c7224622f212df.tar.gz
tor-d1059a936644f1a3c274f97218c7224622f212df.zip
Add optional target directory parameter to coverage script and add reset-gcov target to Makefile.am
-rw-r--r--Makefile.am3
-rw-r--r--changes/bug92674
-rwxr-xr-xcontrib/coverage7
3 files changed, 14 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 1bc1077ebb..0361d87cec 100644
--- a/Makefile.am
+++ b/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:
diff --git a/changes/bug9267 b/changes/bug9267
new file mode 100644
index 0000000000..95a621148d
--- /dev/null
+++ b/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.
diff --git a/contrib/coverage b/contrib/coverage
index f51649a78e..8d971660c9 100755
--- a/contrib/coverage
+++ b/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