mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-01 08:03:31 +01:00
db94d7fed2
The new gcov sometimes emits *s if there is a line containing multiple basic blocks, and some are not executed. (The gcov documentation says something weird about this point, so I'm trying to interpret it into the compilerese that I'm familiar with.) That's bug 26101. Also, when we're looking for unique variations in our coverage, we would like cov-diff to suppress timestamps on the diffs. That's bug 26102. Both of these are bugfixes on 0.2.5.1-alpha when the cov-diff script was introduced. My apologies for the perl.
22 lines
627 B
Bash
Executable File
22 lines
627 B
Bash
Executable File
#!/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 B in $DIRB/*; do
|
|
A=$DIRA/`basename $B`
|
|
if [ -f $A ]; then
|
|
perl -pe 's/^\s*\!*\d+(\*?):/ 1$1:/; s/^([^:]+:)[\d\s]+:/$1/; s/^ *-:(Runs|Programs):.*//;' "$A" > "$A.tmp"
|
|
else
|
|
cat /dev/null > "$A.tmp"
|
|
fi
|
|
perl -pe 's/^\s*\!*\d+(\*?):/ 1$1:/; s/^([^:]+:)[\d\s]+:/$1/; s/^ *-:(Runs|Programs):.*//;' "$B" > "$B.tmp"
|
|
diff -u "$A.tmp" "$B.tmp" |perl -pe 's/^((?:\+\+\+|---)(?:.*tmp))\s+.*/$1/;'
|
|
rm "$A.tmp" "$B.tmp"
|
|
done
|
|
|