tests: Factorize the 'dummy-package' macro.

* guix/tests.scm (dummy-package): New macro.
* tests/lint.scm (dummy-package): Remove.
* tests/packages.scm (dummy-package): Remove.
This commit is contained in:
Ludovic Courtès 2014-12-29 19:11:09 +01:00
parent 907c98acbb
commit 8b385969cf
3 changed files with 12 additions and 14 deletions

View File

@ -27,7 +27,8 @@
#:export (open-connection-for-tests #:export (open-connection-for-tests
random-text random-text
random-bytevector random-bytevector
with-derivation-narinfo)) with-derivation-narinfo
dummy-package))
;;; Commentary: ;;; Commentary:
;;; ;;;
@ -120,6 +121,15 @@ substituter's viewpoint."
(lambda () (lambda ()
body ...))) body ...)))
(define-syntax-rule (dummy-package name* extra-fields ...)
"Return a \"dummy\" package called NAME*, with all its compulsory fields
initialized with default values, and with EXTRA-FIELDS set as specified."
(package extra-fields ...
(name name*) (version "0") (source #f)
(build-system gnu-build-system)
(synopsis #f) (description #f)
(home-page #f) (license #f)))
;; Local Variables: ;; Local Variables:
;; eval: (put 'call-with-derivation-narinfo 'scheme-indent-function 1) ;; eval: (put 'call-with-derivation-narinfo 'scheme-indent-function 1)
;; End: ;; End:

View File

@ -19,6 +19,7 @@
(define-module (test-packages) (define-module (test-packages)
#:use-module (guix tests)
#:use-module (guix build download) #:use-module (guix build download)
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
#:use-module (guix packages) #:use-module (guix packages)
@ -105,12 +106,6 @@ requests."
(test-begin "lint") (test-begin "lint")
(define-syntax-rule (dummy-package name* extra-fields ...)
(package extra-fields ... (name name*) (version "0") (source #f)
(build-system gnu-build-system)
(synopsis #f) (description #f)
(home-page #f) (license #f) ))
(define (call-with-warnings thunk) (define (call-with-warnings thunk)
(let ((port (open-output-string))) (let ((port (open-output-string)))
(parameterize ((guix-warning-port port)) (parameterize ((guix-warning-port port))

View File

@ -48,13 +48,6 @@
(define %store (define %store
(open-connection-for-tests)) (open-connection-for-tests))
(define-syntax-rule (dummy-package name* extra-fields ...)
(package (name name*) (version "0") (source #f)
(build-system gnu-build-system)
(synopsis #f) (description #f)
(home-page #f) (license #f)
extra-fields ...))
(test-begin "packages") (test-begin "packages")