gnu: python: Honour #:tests? and #:test-target in build system.

* guix/build/python-build-system.scm (check): Use named parameters tests?
    and test-target (default now: "test" instead of "check").
This commit is contained in:
Andreas Enge 2013-09-05 18:43:18 +02:00
parent d1f30e9943
commit 7b96bf82da
1 changed files with 9 additions and 6 deletions

View File

@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org> ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
@ -45,13 +46,15 @@
(zero? (apply system* "python" args))) (zero? (apply system* "python" args)))
(error "no setup.py found")))) (error "no setup.py found"))))
(define* (check #:key outputs #:allow-other-keys) (define* (check #:key outputs tests? test-target #:allow-other-keys)
"Run the test suite of a given Python package." "Run the test suite of a given Python package."
(if (file-exists? "setup.py") (if tests?
(let ((args `("setup.py" "check"))) (if (file-exists? "setup.py")
(format #t "running 'python' with arguments ~s~%" args) (let ((args `("setup.py" ,test-target)))
(zero? (apply system* "python" args))) (format #t "running 'python' with arguments ~s~%" args)
(error "no setup.py found"))) (zero? (apply system* "python" args)))
(error "no setup.py found"))
#t))
(define* (wrap #:key inputs outputs #:allow-other-keys) (define* (wrap #:key inputs outputs #:allow-other-keys)
(define (list-of-files dir) (define (list-of-files dir)