summary refs log tree commit diff
path: root/tests/derivations.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-06-09 21:52:31 +0200
committerLudovic Courtès <ludo@gnu.org>2012-06-09 21:52:31 +0200
commit7946c4e710b921c9354ef74557872926d48ea42a (patch)
tree2685b75fd604840b69ee5fdaef0f17b987c1084a /tests/derivations.scm
parentaf7f9e5f13106ccfd6c9144e40dff5071672b195 (diff)
downloadguix-7946c4e710b921c9354ef74557872926d48ea42a.tar.gz
Add `derivation' test for multiple-output derivations.
* tests/derivations.scm ("multiple-output derivation"): New test.
Diffstat (limited to 'tests/derivations.scm')
-rw-r--r--tests/derivations.scm18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/derivations.scm b/tests/derivations.scm
index dd4f9ee254..5d4fea8403 100644
--- a/tests/derivations.scm
+++ b/tests/derivations.scm
@@ -85,6 +85,24 @@
            (equal? (string->utf8 "hello")
                    (call-with-input-file p get-bytevector-all))))))
 
+(test-assert "multiple-output derivation"
+  (let* ((builder    (add-text-to-store %store "my-fixed-builder.sh"
+                                        "echo one > $out ; echo two > $second"
+                                        '()))
+         (drv-path   (derivation %store "fixed" "x86_64-linux"
+                                 "/bin/sh" `(,builder)
+                                 '(("HOME" . "/homeless")
+                                   ("zzz"  . "Z!")
+                                   ("AAA"  . "A!"))
+                                 `((,builder))
+                                 #:outputs '("out" "second")))
+         (succeeded? (build-derivations %store (list drv-path))))
+    (and succeeded?
+         (let ((one (derivation-path->output-path drv-path "out"))
+               (two (derivation-path->output-path drv-path "second")))
+           (and (eq? 'one (call-with-input-file one read))
+                (eq? 'two (call-with-input-file two read)))))))
+
 
 (define %coreutils
   (false-if-exception (nixpkgs-derivation "coreutils")))