cov-diff 636 B

1234567891011121314151617181920
  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$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$1:/; s/^([^:]+:)[\d\s]+:/$1/; s/^ *-:(Runs|Programs):.*//;' "$B" > "$B.tmp"
  15. diff -u "$A.tmp" "$B.tmp" |perl -pe 's/^((?:\+\+\+|---)(?:.*tmp))\s+.*/$1/;'
  16. rm -f "$A.tmp" "$B.tmp"
  17. done