cov-diff 562 B

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