guix build: Add '--without-tests'.

* guix/scripts/build.scm (transform-package-tests): New procedure.
(%transformations, %transformation-options)
show-transformation-options-help): Add it.
* tests/scripts-build.scm ("options->transformation, without-tests"):
New test.
* doc/guix.texi (Package Transformation Options): Document it.
This commit is contained in:
Ludovic Courtès 2020-09-23 22:29:17 +02:00
parent d753aee0be
commit f458cfbcc5
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
3 changed files with 64 additions and 3 deletions

View file

@ -264,5 +264,19 @@
((("x" dep3))
(map package-source (list dep1 dep3))))))))))))
(test-assert "options->transformation, without-tests"
(let* ((dep (dummy-package "dep"))
(p (dummy-package "foo"
(inputs `(("dep" ,dep)))))
(t (options->transformation '((without-tests . "dep")
(without-tests . "tar")))))
(with-store store
(let ((new (t store p)))
(match (bag-direct-inputs (package->bag new))
((("dep" dep) ("tar" tar) _ ...)
;; TODO: Check whether TAR has #:tests? #f when transformations
;; apply to implicit inputs.
(equal? (package-arguments dep)
'(#:tests? #f))))))))
(test-end)