From 11b5443e48f9c0d24ae58ac15a35246fa76b71d6 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Sun, 29 Jun 2025 15:52:47 +0200 Subject: [PATCH] tests: Support basic tests extension with an extra-tests argument. * gnu/tests/base.scm (run-basic-test)[extra-tests]: New argument. Change-Id: Ia3595638309738d3361c583c93a66e0a872adabe --- gnu/tests/base.scm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index 720a5eb10d5..d60eef2b119 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -74,7 +74,8 @@ #:key initialization root-password - desktop?) + desktop? + extra-tests) "Return a derivation called NAME that tests basic features of the OS started using COMMAND, a gexp that evaluates to a list of strings. Compare some properties of running system to what's declared in OS, an . @@ -85,7 +86,12 @@ inserted before the first test. This is used to introduce an extra initialization step, such as entering a LUKS passphrase. When ROOT-PASSWORD is true, enter it as the root password when logging in. -Otherwise assume that there is no password for root." +Otherwise assume that there is no password for root. + +When EXTRA-TESTS is true, it must be a one-argument procedure that is +passed a gexp denoting the marionette. It must then return a gexp that is +inserted after the last test. This is meant as a way of extending the basic +tests that are defined within this procedure." (define special-files (service-value (fold-services (operating-system-services os) @@ -581,6 +587,9 @@ test \"$BASHRC_D_OK\" = yes")) (compose string-trim-right get-string-all))) marionette)) + #$(and extra-tests + (extra-tests #~marionette)) + (test-end)))) (gexp->derivation name test))