Page MenuHomeFreeBSD

mk: add PLAIN_TESTS_PORCH support
ClosedPublic

Authored by kevans on Sep 27 2024, 5:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 4:51 AM
Unknown Object (File)
Tue, Nov 12, 6:23 PM
Unknown Object (File)
Sat, Nov 9, 4:56 PM
Unknown Object (File)
Sat, Nov 9, 4:56 PM
Unknown Object (File)
Sat, Nov 9, 4:56 PM
Unknown Object (File)
Sat, Nov 9, 4:56 PM
Unknown Object (File)
Sat, Nov 9, 3:32 AM
Unknown Object (File)
Thu, Nov 7, 4:55 PM

Details

Summary

porch(1), available via sysutils/porch, is an expect(1)-like program
that uses lua instead of tcl for scripting. Imminent use will be to
execute tests of tty canonicalization to ensure we don't regress some of
the corner cases we've fixed, but tests for other interactive programs
are being considered as well.

PLAIN_TESTS_PORCH is being introduced primarily to get the metadata
right without writing it out for every single test; required_programs
ensures that we skip the tests if the port is not installed.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

It seems like this should be named "PORCH_TESTS" instead of "PLAIN_TESTS_PORCH" (that seems pretty wordy..).
Or maybe something LUA-prefixed?
PLAIN_TESTS is the variant of test which has a certain expected/documented behavior, whereas, _CXX, _C, _SH are the file types under test. Are all "PORCH" tests expected to exit on 0 if successful and exit non-zero if failed?

It seems like this should be named "PORCH_TESTS" instead of "PLAIN_TESTS_PORCH" (that seems pretty wordy..).
Or maybe something LUA-prefixed?
PLAIN_TESTS is the variant of test which has a certain expected/documented behavior, whereas, _CXX, _C, _SH are the file types under test. Are all "PORCH" tests expected to exit on 0 if successful and exit non-zero if failed?

Right, these are expected to follow the exact same convention and why I tried to be consistent with the other extensions. I waffled between PORCH and ORCH, the latter is the extension we're using but the former is the program name and provides better searchability elsewhere.

Edit to add: one of the main points that I'm not making very clearly/explicitly is that I don't want to tie porch(1) down into any particular test type. I might expand it later to facilitate TAP, but I need to munch on that a bit more and consider if I can come up with a design that makes sense to me. Today, it follows the plain test protocol.

0mp added inline comments.
share/mk/plain.test.mk
57

Could we do it in one step with install(1)?

kevans marked an inline comment as done.

Simplify; this was previously going to go the route of atf-sh and inject the
shebang, but what we ended up with does not warrant a tmp file at all. We can
also take care of +x + move in one step.

This revision is now accepted and ready to land.Oct 2 2024, 9:35 AM
share/mk/plain.test.mk
53–54

Is this needed? It seems like just adding PLAIN_TESTS_PORCH to SCRIPTS should be enough.

share/mk/plain.test.mk
53–54

I was mainly looking to chop off the suffix for consistency with other binary test programs, but I don't think I actually feel that strongly about it if we'd prefer to just add PLAIN_TESTS_ORCH:S/$/.orch/ and call it a day -- I don't see anything that would break from retainin the suffix.

share/mk/plain.test.mk
53–54

I was mainly looking to chop off the suffix for consistency with other binary test programs, but I don't think I actually feel that strongly about it if we'd prefer to just add PLAIN_TESTS_ORCH:S/$/.orch/ and call it a day -- I don't see anything that would break from retainin the suffix.

bsd.prog.mk chops off the suffix for you:

% cat Makefile 
SCRIPTS+=       foo.orch

.include <bsd.prog.mk>
% make -n install
install  -o root  -g wheel -m 555  /usr/home/ngie/foo.orch  /foo

You have to use a pattern like SCRIPTSNAME_foo.orch=foo.orch to retain the extension ;).

That's why I asked if this was needed (it seems like unnecessary logic).

Switch to just using SCRIPTS

We just need to tack the extension back on for SCRIPTS/SCRIPTSDIR, the rest
remains extension-less to keep consistent with other test vars.

This revision now requires review to proceed.Oct 8 2024, 5:31 AM
This revision is now accepted and ready to land.Sun, Oct 20, 2:11 AM
This revision was automatically updated to reflect the committed changes.