[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
18/28: build-system/asdf: Handle tests defined in external systems.
From: |
Ricardo Wurmus |
Subject: |
18/28: build-system/asdf: Handle tests defined in external systems. |
Date: |
Tue, 16 May 2017 09:24:36 -0400 (EDT) |
rekado pushed a commit to branch master
in repository guix.
commit 0383afa02ae3777a0adb5304cb6918a2a5f5f250
Author: Andy Patterson <address@hidden>
Date: Sat Apr 8 23:43:31 2017 -0400
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-system/asdf.scm | 4 +++-
guix/build/asdf-build-system.scm | 8 ++++++--
guix/build/lisp-utils.scm | 18 +++++++++++++++---
3 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/guix/build-system/asdf.scm b/guix/build-system/asdf.scm
index f842fdc..ec8b644 100644
--- a/guix/build-system/asdf.scm
+++ b/guix/build-system/asdf.scm
@@ -199,7 +199,7 @@ set up using CL source package conventions."
(define base-arguments
(if target-is-source?
(strip-keyword-arguments
- '(#:tests? #:asd-file #:lisp #:asd-system-name)
+ '(#:tests? #:asd-file #:lisp #:asd-system-name #:test-asd-file)
(package-arguments pkg))
(package-arguments pkg)))
@@ -266,6 +266,7 @@ set up using CL source package conventions."
(tests? #t)
(asd-file #f)
(asd-system-name #f)
+ (test-asd-file #f)
(phases '(@ (guix build asdf-build-system)
%standard-phases))
(search-paths '())
@@ -296,6 +297,7 @@ set up using CL source package conventions."
(source source))
#:asd-file ,(or asd-file (string-append system-name
".asd"))
#:asd-system-name ,system-name
+ #:test-asd-file ,test-asd-file
#:system ,system
#:tests? ,tests?
#:phases ,phases
diff --git a/guix/build/asdf-build-system.scm b/guix/build/asdf-build-system.scm
index 1e0a2f6..c5e820a 100644
--- a/guix/build/asdf-build-system.scm
+++ b/guix/build/asdf-build-system.scm
@@ -131,12 +131,16 @@ valid."
#t)
(define* (check #:key tests? outputs inputs asd-file asd-system-name
+ test-asd-file
#:allow-other-keys)
"Test the system."
(let* ((out (library-output outputs))
- (asd-file (source-asd-file out asd-system-name asd-file)))
+ (asd-file (source-asd-file out asd-system-name asd-file))
+ (test-asd-file
+ (and=> test-asd-file
+ (cut source-asd-file out asd-system-name <>))))
(if tests?
- (test-system asd-system-name asd-file)
+ (test-system asd-system-name asd-file test-asd-file)
(format #t "test suite not run~%")))
#t)
diff --git a/guix/build/lisp-utils.scm b/guix/build/lisp-utils.scm
index 3b441cf..21cb620 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)
- branch master updated (7ee7ee1 -> 6db77c7), Ricardo Wurmus, 2017/05/16
- 02/28: gnu: cl-slynk: Explain some naming choices., Ricardo Wurmus, 2017/05/16
- 08/28: build-system/asdf: Keep ecl's generated archive files., Ricardo Wurmus, 2017/05/16
- 03/28: build-system/asdf: Rename %install-prefix to %source-install-prefix., Ricardo Wurmus, 2017/05/16
- 01/28: gnu: cl-slynk: Clarify the description., Ricardo Wurmus, 2017/05/16
- 04/28: build-system/asdf: Make it possible to use "lib" as the build output., Ricardo Wurmus, 2017/05/16
- 17/28: gnu: sbcl-slynk-boot0: Give the package an appropriate name., Ricardo Wurmus, 2017/05/16
- 21/28: gnu: java-stringtemplate-3: Do not hardcode version string., Ricardo Wurmus, 2017/05/16
- 25/28: gnu: stringtemplate4: Prettify "generate-grammar" phase., Ricardo Wurmus, 2017/05/16
- 18/28: build-system/asdf: Handle tests defined in external systems.,
Ricardo Wurmus <=
- 14/28: gnu: Add cl-unicode., Ricardo Wurmus, 2017/05/16
- 06/28: build-system/asdf: Use asdf to determine dependencies., Ricardo Wurmus, 2017/05/16
- 05/28: gnu: cl-stumpwm: Build the library in "lib" and the program in "bin"., Ricardo Wurmus, 2017/05/16
- 11/28: build-system/asdf: Pass the system name as an argument to the builder., Ricardo Wurmus, 2017/05/16
- 23/28: gnu: java-stringtemplate-3: Use return value in build phase., Ricardo Wurmus, 2017/05/16
- 12/28: build-system/asdf: Always pre-load the system's definition file., Ricardo Wurmus, 2017/05/16
- 09/28: build-system/asdf: Make #:lisp a package argument., Ricardo Wurmus, 2017/05/16
- 26/28: gnu: Rename stringtemplate4 to java-stringtemplate., Ricardo Wurmus, 2017/05/16
- 13/28: build-system/asdf: Handle unusually-named systems., Ricardo Wurmus, 2017/05/16
- 19/28: doc: Update the documentation for the asdf build systems., Ricardo Wurmus, 2017/05/16