cov-diff (636B)
1 #!/bin/sh 2 # Copyright 2013 The Tor Project, Inc. 3 # See LICENSE for licensing information. 4 5 # cov-diff -- compare two directories full of gcov files. 6 7 DIRA="$1" 8 DIRB="$2" 9 10 for B in "$DIRB"/*; do 11 A=$DIRA/$(basename "$B") 12 if [ -f "$A" ]; then 13 perl -pe 's/^\s*\!*\d+(\*?):/ 1$1:/; s/^([^:]+:)[\d\s]+:/$1/; s/^ *-:(Runs|Programs):.*//;' "$A" > "$A.tmp" 14 else 15 cat /dev/null > "$A.tmp" 16 fi 17 perl -pe 's/^\s*\!*\d+(\*?):/ 1$1:/; s/^([^:]+:)[\d\s]+:/$1/; s/^ *-:(Runs|Programs):.*//;' "$B" > "$B.tmp" 18 diff -u "$A.tmp" "$B.tmp" |perl -pe 's/^((?:\+\+\+|---)(?:.*tmp))\s+.*/$1/;' 19 rm -f "$A.tmp" "$B.tmp" 20 done