guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Ludovic Courtès
Subject: 02/06: tests: Use 'fold-module-public-variables' for discovery.
Date: Thu, 4 May 2017 12:05:11 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 67d84d6335ae84ac7c217061570e6b968060073c
Author: Ludovic Courtès <address@hidden>
Date:   Thu May 4 11:43:01 2017 +0200

    tests: Use 'fold-module-public-variables' for discovery.
    
    * gnu/tests.scm (fold-system-tests): Write in terms of
    'fold-module-public-variables'.
---
 gnu/tests.scm | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/gnu/tests.scm b/gnu/tests.scm
index 0df6e5a..810711a 100644
--- a/gnu/tests.scm
+++ b/gnu/tests.scm
@@ -27,7 +27,7 @@
   #: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 @@ the system under test."
 (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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]