From ce45eb4c385e3b473bc6746a8b58452865f69977 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 13 Feb 2015 23:14:05 +0100 Subject: gexp: Add #:graft? parameter to 'gexp->derivation'. * guix/gexp.scm (gexp->derivation): Add #:graft? parameter and honor it. * tests/gexp.scm ("gexp->derivation vs. grafts"): New test. * doc/guix.texi (G-Expressions): Update 'gexp->derivation' documentation. --- tests/gexp.scm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') diff --git a/tests/gexp.scm b/tests/gexp.scm index 68c470d3b6..0b189b570b 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -249,6 +249,23 @@ (equal? refs (list (dirname (dirname guile)))) (equal? refs2 (list file)))))) +(test-assertm "gexp->derivation vs. grafts" + (mlet* %store-monad ((p0 -> (dummy-package "dummy" + (arguments + '(#:implicit-inputs? #f)))) + (r -> (package (inherit p0) (name "DuMMY"))) + (p1 -> (package (inherit p0) (replacement r))) + (exp0 -> (gexp (frob (ungexp p0) (ungexp output)))) + (exp1 -> (gexp (frob (ungexp p1) (ungexp output)))) + (void (set-guile-for-build %bootstrap-guile)) + (drv0 (gexp->derivation "t" exp0)) + (drv1 (gexp->derivation "t" exp1)) + (drv1* (gexp->derivation "t" exp1 #:graft? #f))) + (return (and (not (string=? (derivation->output-path drv0) + (derivation->output-path drv1))) + (string=? (derivation->output-path drv0) + (derivation->output-path drv1*)))))) + (test-assertm "gexp->derivation, composed gexps" (mlet* %store-monad ((exp0 -> (gexp (begin (mkdir (ungexp output)) -- cgit v1.2.3