2 # SPDX-FileCopyrightText: Eric S. Raymond
3 # SPDX-License-Identifier: BSD-2-Clause
5 # tapdiffer - Render diff between input and checkfile as a TAP report
7 # Usage: tapdiffer LEGEND CHECKFILE
9 # Output is a TAP report, ok if the diff is empty and not ok otherwise.
10 # A nonempty diff is shipped as a TAP YAML block following "not ok"
11 # unless QUIET=1 in the environment.
24 trap 'rm /tmp/tapdiff$$' EXIT HUP INT QUIT TERM
26 if diff --text "${diffopts}" ${checkfile} - >/tmp/tapdiff$$
30 echo "not ok - ${checkfile}: ${legend}"
31 if [ ! "${QUIET}" = 1 ]
34 sed </tmp/tapdiff$$ -e 's/^/ /'