HomeFreeBSD

tests: skip gracefully when the tested binary's own package isn't installed

Description

tests: skip gracefully when the tested binary's own package isn't installed

pkgbase splits programs and their tests into separate packages (e.g.
unifdef/yacc/indent/file2c -> toolchain, jail -> jail, etc), while their
tests always land in the generic tests package. Installing just the
tests package therefore leaves these suites unable to find the binary
they exercise, and they fail confusingly instead of skipping.

Rather than force all packages to be installed for the tests package,
make the tests cope with the missing packages. Add require.progs (or,
for TAP/PLAIN-style suites with no atf_set hook: TEST_METADATA
required_programs) for the binary under test in: bectl, certctl,
ctfconvert, dhclient, file2c, indent, ipfw, jail, lastcomm, mixer,
newsyslog, nvmecontrol, pfctl, praudit, sa, syslogd, tunefs, unifdef,
yacc, ztest.

I skipped adding data for all the binaries in the base runtime
package for simplicity.

Assisted-by: Claude Code (Sonnet 5)
Sponsored by: Netflix
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D58262

Details

Provenance
impAuthored on Fri, Sep 11, 5:42 AM
Reviewer
ngie
Differential Revision
D58262: tests: skip gracefully when the tested binary's own package isn't installed
Parents
rG73df5f2ec93a: man: Do glob expansion with echo instead of ls
Branches
Unknown
Tags
Unknown