From 0383afa02ae3777a0adb5304cb6918a2a5f5f250 Mon Sep 17 00:00:00 2001 From: Andy Patterson Date: Sat, 8 Apr 2017 23:43:31 -0400 Subject: 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. --- guix/build/lisp-utils.scm | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'guix/build/lisp-utils.scm') 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) -- cgit v1.2.3