aboutsummaryrefslogtreecommitdiff
path: root/scripts/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-05-14 18:04:10 -0400
committerNick Mathewson <nickm@torproject.org>2018-05-14 18:04:10 -0400
commitdb94d7fed246e617fe953751a8f506f9b57c2fda (patch)
treefc65da46fdff17b98d0779e89968efc95ba94ca1 /scripts/test
parentaab626405c312a33d521c9ca3729552fd9ccca2e (diff)
downloadtor-db94d7fed246e617fe953751a8f506f9b57c2fda.tar.gz
tor-db94d7fed246e617fe953751a8f506f9b57c2fda.zip
Update cov-diff to handle new gcov, and remove timestamps
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.
Diffstat (limited to 'scripts/test')
-rwxr-xr-xscripts/test/cov-diff6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/test/cov-diff b/scripts/test/cov-diff
index ed8874d2d3..6179dff63e 100755
--- a/scripts/test/cov-diff
+++ b/scripts/test/cov-diff
@@ -10,12 +10,12 @@ DIRB="$2"
for B in $DIRB/*; do
A=$DIRA/`basename $B`
if [ -f $A ]; then
- perl -pe 's/^\s*\!*\d+:/ 1:/; s/^([^:]+:)[\d\s]+:/$1/; s/^ *-:(Runs|Programs):.*//;' "$A" > "$A.tmp"
+ 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:/; s/^([^:]+:)[\d\s]+:/$1/; s/^ *-:(Runs|Programs):.*//;' "$B" > "$B.tmp"
- diff -u "$A.tmp" "$B.tmp"
+ 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