(define-module (ruther tests)
#:use-module (gnu tests)
#:use-module (guix discovery)
#:use-module (guix ui)
#:export (ruther-test-modules
fold-ruther-system-tests
ruther-system-tests))
(define (ruther-test-modules)
"Return the list of modules that define system tests."
(scheme-modules (dirname (search-path %load-path "ruther.scm"))
"ruther/tests"
#:warn warn-about-load-error))
(define (fold-ruther-system-tests proc seed)
"Invoke PROC on each system test, passing it the test and the previous
result."
(fold-module-public-variables (lambda (obj result)
(if (system-test? obj)
(cons obj result)
result))
'()
(ruther-test-modules)))
(define (ruther-system-tests)
"Return the list of system tests."
(reverse (fold-ruther-system-tests cons '())))