From 9bc07f4df0b69b4eae86e8ca574713e3048d9a31 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 9 Jun 2012 23:16:55 +0200 Subject: Add multiple-output support to `build-expression->derivation'. * guix/derivations.scm (build-expression->derivation): Add `outputs' keyword parameter; pass it to `derivation'. Define `%outputs' in the prologue. * tests/derivations.scm ("build-expression->derivation with two outputs"): New test. --- tests/derivations.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests') diff --git a/tests/derivations.scm b/tests/derivations.scm index 5d4fea8403..cbeedde4a1 100644 --- a/tests/derivations.scm +++ b/tests/derivations.scm @@ -145,6 +145,26 @@ (equal? '(hello guix) (call-with-input-file (string-append p "/test") read)))))) +(test-assert "build-expression->derivation with two outputs" + (let* ((builder '(begin + (call-with-output-file (assoc-ref %outputs "out") + (lambda (p) + (display '(hello) p))) + (call-with-output-file (assoc-ref %outputs "second") + (lambda (p) + (display '(world) p))))) + (drv-path (build-expression->derivation %store "double" + "x86_64-linux" + builder '() + #:outputs '("out" + "second"))) + (succeeded? (build-derivations %store (list drv-path)))) + (and succeeded? + (let ((one (derivation-path->output-path drv-path)) + (two (derivation-path->output-path drv-path "second"))) + (and (equal? '(hello) (call-with-input-file one read)) + (equal? '(world) (call-with-input-file two read))))))) + (test-assert "build-expression->derivation with one input" (let* ((builder '(call-with-output-file %output (lambda (p) -- cgit v1.2.3