aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-07-09 12:54:39 -0400
committerNick Mathewson <nickm@torproject.org>2013-07-10 15:22:16 -0400
commit4753ad4f1dbd7fa3233ead5770e9c8bd619b8d07 (patch)
treef8b95f92d168534ca2bcb41dbd23c44594539056 /contrib
parent17e9fc09c31dffdc647385220a14daef5a35273a (diff)
downloadtor-4753ad4f1dbd7fa3233ead5770e9c8bd619b8d07.tar
tor-4753ad4f1dbd7fa3233ead5770e9c8bd619b8d07.tar.gz
Add a script to compare directories full of gcov output
We can't just use "diff", since we don't care about changes in line numbers, or changes in the exact number of times a line was called. We just care about changes that make lines covered or non-coverd. So pre-process the files before calling diff.
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/cov-diff17
1 files changed, 17 insertions, 0 deletions
diff --git a/contrib/cov-diff b/contrib/cov-diff
new file mode 100755
index 000000000..33a54802b
--- /dev/null
+++ b/contrib/cov-diff
@@ -0,0 +1,17 @@
+#!/bin/sh
+# Copyright 2013 The Tor Project, Inc.
+# See LICENSE for licensing information.
+
+# cov-diff -- compare two directories full of gcov files.
+
+DIRA="$1"
+DIRB="$2"
+
+for A in $DIRA/*; do
+ B=$DIRB/`basename $A`
+ perl -pe 's/^\s*\d+:/ 1:/; s/^([^:]+:)[\d\s]+:/$1/;' "$A" > "$A.tmp"
+ perl -pe 's/^\s*\d+:/ 1:/; s/^([^:]+:)[\d\s]+:/$1/;' "$B" > "$B.tmp"
+ diff -u "$A.tmp" "$B.tmp"
+ rm "$A.tmp" "$B.tmp"
+done
+