aboutsummaryrefslogtreecommitdiff
path: root/tests/derivations.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-10-30 19:09:32 +0100
committerLudovic Courtès <ludo@gnu.org>2013-10-30 22:09:32 +0100
commitd0dc4907d6dac82ba482472845e83d7411c74ed5 (patch)
treecb3e79cef81064604028a86b6453e713198dae3a /tests/derivations.scm
parentd595e456c1555de5a4ffdbcd7cf99e07b06e2a4f (diff)
downloadgnu-guix-d0dc4907d6dac82ba482472845e83d7411c74ed5.tar
gnu-guix-d0dc4907d6dac82ba482472845e83d7411c74ed5.tar.gz
derivations: 'derivation-path->output-path' honors the 'output' parameter.
* guix/derivations.scm (derivation-path->output-path): Pass OUTPUT. * tests/derivations.scm ("multiple-output derivation, derivation-path->output-path"): New test.
Diffstat (limited to 'tests/derivations.scm')
-rw-r--r--tests/derivations.scm17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/derivations.scm b/tests/derivations.scm
index 4756fb9cba..1b32ab5ffd 100644
--- a/tests/derivations.scm
+++ b/tests/derivations.scm
@@ -260,6 +260,23 @@
(and (eq? 'one (call-with-input-file one read))
(eq? 'two (call-with-input-file two read)))))))
+(test-assert "multiple-output derivation, derivation-path->output-path"
+ (let* ((builder (add-text-to-store %store "builder.sh"
+ "echo one > $out ; echo two > $second"
+ '()))
+ (drv (derivation %store "multiple"
+ %bash `(,builder)
+ #:outputs '("out" "second")))
+ (drv-file (derivation-file-name drv))
+ (one (derivation->output-path drv "out"))
+ (two (derivation->output-path drv "second"))
+ (first (derivation-path->output-path drv-file "out"))
+ (second (derivation-path->output-path drv-file "second")))
+ (and (not (string=? one two))
+ (string-suffix? "-second" two)
+ (string=? first one)
+ (string=? second two))))
+
(test-assert "user of multiple-output derivation"
;; Check whether specifying several inputs coming from the same
;; multiple-output derivation works.