orch(1) for tty testing

From: Kyle Evans <kevans_at_FreeBSD.org>
Date: Mon, 15 Jan 2024 19:54:54 UTC
Hi,

I wrote a tool for tty testing w/ lua scripts, inspired by expect(1) and 
with some similarities, but explicitly without the goal of trying to be 
compatible:

https://git.kevans.dev/kevans/orch

An example of its use is here:

https://git.kevans.dev/kevans/tty-tests/src/branch/main/test_canon.orch

Each spawn() creates a new pts(4) and allows us to drive I/O to the 
process with write/match statements.  I have one or two tests written 
with it so far and the end result is, IMO, much less painful looking and 
less error prone than the equivalent in C.

It still needs a bit of polish (e.g., improved diagnostics when a match 
fails), but I'd like to consider importing this somewhere for use in the 
near future for tty testing given how much it simplifies.  I can push it 
to ports, but we have a private liblua in base so it could be built and 
banished off into, e.g., /usr/tests/sys/kern/tty/, to make my life just 
a tad easier re: getting these to run in CI.  It's pretty lightweight; 
the orch binary on my amd64 system clocks in at ~27K, and orch.lua at 13K.

Any objections to importing this new tool into /usr/tests or maybe even 
/usr/libexec?

Thanks,

Kyle Evans