TAPDIFFER(1)

πŸ“¦ version 1.15, in nixos 26.05, nixpkgs unstable

πŸ’… TAPDIFFER(1) πŸ’…

okay so welcome to tapdiffer(1), bestie β€” the little TAP-line generator that compares your input against a check file, and honestly? she ate. ✨


πŸŽ€ NAME πŸŽ€

tapdiffer β€” a TAP-line generator that compares input against a check file πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

tapdiffer [-b] legend checkfile

🌸 DESCRIPTION 🌸

So here's the vibe: this utility is a TAP producer. It takes standard input, compares it against the checkfile you named, and reports back. The output starts with an unnumbered TAP report line β€” and inside that line, the checkfile and legend arguments are what supply the text part. iykyk πŸ‘‘

If the diff comes back empty, the report is a solitary ok line. Iconic. Clean. No notes. πŸ’…

If the diff is nonempty, the report is a not ok line followed by the diff itself, formatted as a TAP14 YAML attachment. 😭

🫢 heads up: if the environment variable QUIET is nonempty, the YAML section gets suppressed. silence is golden, etc etc.

Now, the -b option β€” if you include it, it tells the diff utility to ignore trailing whitespace and to treat all runs of whitespace within a line as equivalent to a single space. lowkey so useful. ✨

A typical Makefile snippet to invoke this on a set of log (.log) and checkfile (.chk) pairs β€” testing a filter named by FILTER β€” might look like this:

TESTLOADS := $(shell ls *.log | sed '/.log/s///')
tap:
        echo "1..$$(ls *.log | wc -l)"
        @for test in $(TESTLOADS); \
        do \
                legend=$$(sed -n -e '/^## /s///p' <$${test}.log); \
                $(FILTER) <"$${test}.log" | ./tapdiffer "$${legend}" "$${test}.chk"; \
        done

check:
        $(MAKE) tap | tapview

⭐ REQUIREMENTS ⭐

tapdiffer is written in pure POSIX shell, no cap. 🐚

It needs a version of diff(1) that accepts the -u and -b options β€” something like GNU diff. That's literally it. There are no other dependencies. main character energy fr fr 🌈


πŸ’€ ERROR RETURNS πŸ’€

Always returns 0. always. no matter what. she's unbothered. 🧚


πŸ‘‘ AUTHOR πŸ‘‘

Eric S. Raymond esr@thyrsus.com. The public repository is at on GitLab https://gitlab.com/esr/tapview. 🫢


k bye bestie, go write some TAP πŸ’œ β€” this page is from the TAPDIFFER(1) manual, dated 1980-01-01, and it's the whole thing, no crumbs left. πŸ“

πŸ“¦ where this page comes from