Date: Mon, 15 Jan 2024 13:54:54 -0600 From: Kyle Evans <kevans@FreeBSD.org> To: freebsd-arch@freebsd.org Subject: orch(1) for tty testing Message-ID: <478cf238-ab2e-4185-a5eb-4230b5efe735@FreeBSD.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?478cf238-ab2e-4185-a5eb-4230b5efe735>