From 860a6f1ae06151d76d39a402d3d92cc7ea6f36ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 4 Dec 2012 23:46:50 +0100 Subject: derivations: Fix erroneous call to `add-to-store' for local files as input. * guix/derivations.scm (derivation)[inputs]: Fix typo in call to `add-to-store'. * tests/derivations.scm ("derivation with local file as input"): New test. * tests/packages.scm ("trivial with local file as input"): New test. --- tests/packages.scm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/packages.scm') diff --git a/tests/packages.scm b/tests/packages.scm index cb69e4be4e..c89f6e7721 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -29,6 +29,7 @@ #:use-module (distro packages bootstrap) #:use-module (srfi srfi-26) #:use-module (srfi srfi-64) + #:use-module (rnrs io ports) #:use-module (ice-9 match)) ;; Test the high-level packaging layer. @@ -89,6 +90,22 @@ (equal? '(hello guix) (call-with-input-file (string-append p "/test") read)))))) +(test-assert "trivial with local file as input" + (let* ((i (search-path %load-path "ice-9/boot-9.scm")) + (p (package (inherit (dummy-package "trivial-with-input-file")) + (build-system trivial-build-system) + (source #f) + (arguments + `(#:guile ,%bootstrap-guile + #:builder (copy-file (assoc-ref %build-inputs "input") + %output))) + (inputs `(("input" ,i))))) + (d (package-derivation %store p))) + (and (build-derivations %store (list d)) + (let ((p (pk 'drv d (derivation-path->output-path d)))) + (equal? (call-with-input-file p get-bytevector-all) + (call-with-input-file i get-bytevector-all)))))) + (test-assert "trivial with system-dependent input" (let* ((p (package (inherit (dummy-package "trivial-system-dependent-input")) (build-system trivial-build-system) -- cgit v1.2.3