]> git.saurik.com Git - apt.git/commitdiff
travis: ignore profiling warning in test diffs
authorDavid Kalnischkies <david@kalnischkies.de>
Thu, 10 Nov 2016 20:28:12 +0000 (21:28 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Thu, 10 Nov 2016 20:28:12 +0000 (21:28 +0100)
On Travis CI running tests with code coverage enabled sometimes
generates lines like:
  profiling:/path/to/file.gcda:Merge mismatch for function 257
It would be nice if we could resolve this somehow as it garbles the
statistics, but until then it is far more annoying that this causes
test failures for no good reason.

Gbp-Dch: Ignore

test/integration/framework

index 03633f28ad91396e30bcb202b1d63ff4d51f6bc8..0222f2bc93e53a6bdfd201c92fa6324def6b41b5 100644 (file)
@@ -1394,7 +1394,20 @@ downloadfile() {
 }
 
 checkdiff() {
-       local DIFFTEXT="$(command diff -u "$@" 2>&1 | sed -e '/^---/ d' -e '/^+++/ d' -e '/^@@/ d')"
+       local TMPFILE1="${TMPWORKINGDIRECTORY}/rootdir/tmp/checkdiff.1.tmp"
+       local TMPFILE2="${TMPWORKINGDIRECTORY}/rootdir/tmp/checkdiff.2.tmp"
+       touch "$TMPFILE1" "$TMPFILE2"
+       if [ "$1" != '-' ]; then
+               sed -e '/^profiling:/ d' < "$1" >"$TMPFILE1"
+       else
+               TMPFILE1='-'
+       fi
+       if [ "$2" != '-' ]; then
+               sed -e '/^profiling:/ d' < "$2" >"$TMPFILE2"
+       else
+               TMPFILE2='-'
+       fi
+       local DIFFTEXT="$(command diff -u "$TMPFILE1" "$TMPFILE2" 2>&1 | sed -e '/^---/ d' -e '/^+++/ d' -e '/^@@/ d')"
        if [ -n "$DIFFTEXT" ]; then
                echo >&2
                echo >&2 "$DIFFTEXT"