3 # tapdiffer - Render diff between input and checkfile as a TAP report
5 # Usage: tapdiffer LEGEND CHECKFILE
7 # Output is a TAP report, ok if the diff is empty and not ok otherwise.
8 # A nonempty diff is shipped as a TAP YAML block following "not ok"
9 # unless QUIET=1 in the environment.
14 trap 'rm /tmp/tapdiff$$' EXIT HUP INT QUIT TERM
16 if diff --text -u ${checkfile} - >/tmp/tapdiff$$
21 echo "not ok - ${checkfile}: ${legend}"
22 if [ ! "${QUIET}" = 1 ]
25 sed </tmp/tapdiff$$ -e 's/^/ /'