git: 44f736c385f6 - main - mk: add PLAIN_TESTS_PORCH support

From: Kyle Evans <kevans_at_FreeBSD.org>
Date: Mon, 21 Oct 2024 01:32:42 UTC
The branch main has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=44f736c385f6b8d451feb9d6543220e8e61abcaa

commit 44f736c385f6b8d451feb9d6543220e8e61abcaa
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2024-10-21 01:31:50 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2024-10-21 01:32:31 +0000

    mk: add PLAIN_TESTS_PORCH support
    
    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.
    
    Reviewed by:    0mp (previous version), ngie
    Differential Revision:  https://reviews.freebsd.org/D46805
---
 share/mk/bsd.README    |  3 +++
 share/mk/plain.test.mk | 11 +++++++++++
 2 files changed, 14 insertions(+)

diff --git a/share/mk/bsd.README b/share/mk/bsd.README
index 70d489a9f59f..e957e9cdd48b 100644
--- a/share/mk/bsd.README
+++ b/share/mk/bsd.README
@@ -701,6 +701,9 @@ PLAIN_TESTS_C	The names of the plain (legacy) programs to build.
 
 PLAIN_TESTS_CXX	The names of the plain (legacy) test programs to build.
 
+PLAIN_TESTS_PORCH	The names of the plain (legacy) porch(1)-based
+		test programs to build.
+
 PLAIN_TESTS_SH	The names of the plain (legacy) test programs to build.
 
 TAP_PERL_INTERPRETER
diff --git a/share/mk/plain.test.mk b/share/mk/plain.test.mk
index cc6d268185da..485a78f8ea47 100644
--- a/share/mk/plain.test.mk
+++ b/share/mk/plain.test.mk
@@ -43,6 +43,17 @@ TEST_INTERFACE.${_T}= plain
 .endfor
 .endif
 
+.if !empty(PLAIN_TESTS_PORCH)
+SCRIPTS+= ${PLAIN_TESTS_PORCH:S/$/.orch/}
+_TESTS+= ${PLAIN_TESTS_PORCH}
+.for _T in ${PLAIN_TESTS_PORCH}
+SCRIPTSDIR_${_T}.orch= ${TESTSDIR}
+
+TEST_INTERFACE.${_T}= plain
+TEST_METADATA.${_T}+=	required_programs="porch"
+.endfor
+.endif
+
 .if !empty(PLAIN_TESTS_SH)
 SCRIPTS+= ${PLAIN_TESTS_SH}
 _TESTS+= ${PLAIN_TESTS_SH}