summaryrefslogtreecommitdiff
path: root/gnu/tests.scm
diff options
context:
space:
mode:
authorThijs Paelman <thijs@ouroboros.rocks>2026-01-13 20:07:14 +0100
committerLudovic Courtès <ludo@gnu.org>2026-05-16 00:42:25 +0200
commit55f59e17b10903485506c26779c8ec09f2e3268e (patch)
tree6cbe40ff5d3019a7dc20b164c71a9450ccb8af6c /gnu/tests.scm
parent584a6de69d1f0630189e6efa00b2e541d9e208b7 (diff)
tests: Add ‘modules’ and ‘select?’ parameters to ‘fold-system-tests’.
* gnu/tests.scm (fold-system-tests): Add ‘modules’ and ‘select?’ and honor them. Rename ‘see’ to ‘init’. Change-Id: If4fd75b955459a92e7808c01ed7a7820c4458871 Signed-off-by: Ludovic Courtès <ludo@gnu.org> Merges: #5598
Diffstat (limited to 'gnu/tests.scm')
-rw-r--r--gnu/tests.scm17
1 files changed, 10 insertions, 7 deletions
diff --git a/gnu/tests.scm b/gnu/tests.scm
index aa0875ba5c1..3b12726de82 100644
--- a/gnu/tests.scm
+++ b/gnu/tests.scm
@@ -328,15 +328,18 @@ the system under test."
328 "gnu/tests" 328 "gnu/tests"
329 #:warn warn-about-load-error)) 329 #:warn warn-about-load-error))
330 330
331(define (fold-system-tests proc seed) 331(define* (fold-system-tests proc init
332 "Invoke PROC on each system test, passing it the test and the previous 332 #:optional
333result." 333 (modules (test-modules))
334 #:key (select? (const #t)))
335 "Invoke (PROC SYSTEST RESULT) on each system test, passing it the test and
336the previous result."
334 (fold-module-public-variables (lambda (obj result) 337 (fold-module-public-variables (lambda (obj result)
335 (if (system-test? obj) 338 (if (and (system-test? obj) (select? obj))
336 (cons obj result) 339 (proc obj result)
337 result)) 340 result))
338 '() 341 init
339 (test-modules))) 342 modules))
340 343
341(define (all-system-tests) 344(define (all-system-tests)
342 "Return the list of system tests." 345 "Return the list of system tests."