mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
tests: Use 'fold-module-public-variables' for discovery.
* gnu/tests.scm (fold-system-tests): Write in terms of 'fold-module-public-variables'.
This commit is contained in:
parent
8eb55df488
commit
67d84d6335
1 changed files with 7 additions and 12 deletions
|
@ -27,7 +27,7 @@ (define-module (gnu tests)
|
|||
#:use-module (gnu services)
|
||||
#:use-module (gnu services base)
|
||||
#:use-module (gnu services shepherd)
|
||||
#:use-module ((guix discovery) #:select (scheme-modules))
|
||||
#:use-module (guix discovery)
|
||||
#:use-module (srfi srfi-1)
|
||||
#:use-module (srfi srfi-9 gnu)
|
||||
#:use-module (ice-9 match)
|
||||
|
@ -263,17 +263,12 @@ (define (test-modules)
|
|||
(define (fold-system-tests proc seed)
|
||||
"Invoke PROC on each system test, passing it the test and the previous
|
||||
result."
|
||||
(fold (lambda (module result)
|
||||
(fold (lambda (thing result)
|
||||
(if (system-test? thing)
|
||||
(proc thing result)
|
||||
result))
|
||||
result
|
||||
(module-map (lambda (sym var)
|
||||
(false-if-exception (variable-ref var)))
|
||||
module)))
|
||||
'()
|
||||
(test-modules)))
|
||||
(fold-module-public-variables (lambda (obj result)
|
||||
(if (system-test? obj)
|
||||
(cons obj result)
|
||||
result))
|
||||
'()
|
||||
(test-modules)))
|
||||
|
||||
(define (all-system-tests)
|
||||
"Return the list of system tests."
|
||||
|
|
Loading…
Reference in a new issue