X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=tests%2Ftapdiffer;h=98df500fadbc5e0a83b0189c4206c0b39299884a;hb=25230068fe3afb9d1faa9c606413784294700cef;hp=b529a3931fb55fbf9d642b70103883658aef78c6;hpb=d235313e97a52a7f8d94ff4f3b186be71993e3a1;p=open-adventure.git diff --git a/tests/tapdiffer b/tests/tapdiffer index b529a39..98df500 100755 --- a/tests/tapdiffer +++ b/tests/tapdiffer @@ -1,4 +1,6 @@ #! /bin/sh +# SPDX-FileCopyrightText: Eric S. Raymond +# SPDX-License-Identifier: BSD-2-Clause # # tapdiffer - Render diff between input and checkfile as a TAP report # @@ -8,15 +10,22 @@ # A nonempty diff is shipped as a TAP YAML block following "not ok" # unless QUIET=1 in the environment. # +if [ "$1" = "-w" ] +then + diffopts=-ubZ + shift +else + diffopts=-u +fi + legend=$1 checkfile=$2 trap 'rm /tmp/tapdiff$$' EXIT HUP INT QUIT TERM -if diff --text -u ${checkfile} - >/tmp/tapdiff$$ +if diff --text "${diffopts}" ${checkfile} - >/tmp/tapdiff$$ then echo "ok - ${legend}" - exit 0 else echo "not ok - ${checkfile}: ${legend}" if [ ! "${QUIET}" = 1 ] @@ -25,7 +34,6 @@ else sed