diff options
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/cov-diff | 17 | ||||
-rwxr-xr-x | contrib/coverage | 13 |
2 files changed, 30 insertions, 0 deletions
diff --git a/contrib/cov-diff b/contrib/cov-diff new file mode 100755 index 0000000000..33a54802b6 --- /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 + diff --git a/contrib/coverage b/contrib/coverage new file mode 100755 index 0000000000..52fe96d756 --- /dev/null +++ b/contrib/coverage @@ -0,0 +1,13 @@ +#!/bin/sh +# Copyright 2013 The Tor Project, Inc. +# See LICENSE for licensing information. + +# coverage -- run gcov on the appropriate set of object files to extract +# coverage information. + +for fn in src/{or,common}/*.c; do + BN=`basename $fn` + DN=`dirname $fn` + F=`echo $BN | sed -e 's/\.c$//;'` + gcov -o $DN/src_*$F.o $fn +done |