tests: Use 'fold-module-public-variables' for discovery.

* gnu/tests.scm (fold-system-tests): Write in terms of
'fold-module-public-variables'.
master
Ludovic Courtès 2017-05-04 11:43:01 +02:00
parent 8eb55df488
commit 67d84d6335
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 7 additions and 12 deletions

View File

@ -27,7 +27,7 @@
#:use-module (gnu services) #:use-module (gnu services)
#:use-module (gnu services base) #:use-module (gnu services base)
#:use-module (gnu services shepherd) #: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-1)
#:use-module (srfi srfi-9 gnu) #:use-module (srfi srfi-9 gnu)
#:use-module (ice-9 match) #:use-module (ice-9 match)
@ -263,15 +263,10 @@ the system under test."
(define (fold-system-tests proc seed) (define (fold-system-tests proc seed)
"Invoke PROC on each system test, passing it the test and the previous "Invoke PROC on each system test, passing it the test and the previous
result." result."
(fold (lambda (module result) (fold-module-public-variables (lambda (obj result)
(fold (lambda (thing result) (if (system-test? obj)
(if (system-test? thing) (cons obj result)
(proc thing result)
result)) result))
result
(module-map (lambda (sym var)
(false-if-exception (variable-ref var)))
module)))
'() '()
(test-modules))) (test-modules)))