aboutsummaryrefslogtreecommitdiff
path: root/guix/build/lisp-utils.scm
diff options
context:
space:
mode:
authorAndy Patterson <ajpatter@uwaterloo.ca>2017-04-08 23:43:31 -0400
committerRicardo Wurmus <rekado@elephly.net>2017-05-16 15:18:16 +0200
commit0383afa02ae3777a0adb5304cb6918a2a5f5f250 (patch)
tree1d937ae5c82c3c6cdfba98253ed37dbdc64238bc /guix/build/lisp-utils.scm
parentf56da605d886b1f936d512c35d7057d05f284ec5 (diff)
downloadgnu-guix-0383afa02ae3777a0adb5304cb6918a2a5f5f250.tar
gnu-guix-0383afa02ae3777a0adb5304cb6918a2a5f5f250.tar.gz
build-system/asdf: Handle tests defined in external systems.
* guix/build-system/asdf.scm (asdf-build): Add a #:test-asd-file argument. [builder]: Pass it to the build system. (package-with-build-system)[transform]: Strip it from source systems' arguments. * guix/build/asdf-build-system.scm (check): Pass the fully qualified path to it on to the test-system procedure. * guix/build/lisp-utils.scm (test-system): Load the file, or otherwise one of the often used names for it, before running the tests. Adjust the docstring accordingly.
Diffstat (limited to 'guix/build/lisp-utils.scm')
-rw-r--r--guix/build/lisp-utils.scm18
1 files changed, 15 insertions, 3 deletions
diff --git a/guix/build/lisp-utils.scm b/guix/build/lisp-utils.scm
index 3b441cf802..21cb620d59 100644
--- a/guix/build/lisp-utils.scm
+++ b/guix/build/lisp-utils.scm
@@ -184,12 +184,24 @@ asdf:system-depends-on. First load the system's ASD-FILE."
`(:lib ,(string-append system ".a"))
'())))
-(define (test-system system asd-file)
- "Use a lisp implementation to test SYSTEM using asdf. Load ASD-FILE first."
+(define (test-system system asd-file test-asd-file)
+ "Use a lisp implementation to test SYSTEM using asdf. Load ASD-FILE first.
+Also load TEST-ASD-FILE if necessary."
(lisp-eval-program
`((require :asdf)
(let ((*package* (find-package :asdf)))
- (load ,asd-file))
+ (load ,asd-file)
+ ,@(if test-asd-file
+ `((load ,test-asd-file))
+ ;; Try some likely files.
+ (map (lambda (file)
+ `(when (uiop:file-exists-p ,file)
+ (load ,file)))
+ (list
+ (string-append system "-tests.asd")
+ (string-append system "-test.asd")
+ "tests.asd"
+ "test.asd"))))
(asdf:test-system ,system))))
(define (string->lisp-keyword . strings)