From 58c08df0544bc39b3b5a8f6638f776159b6b8d8e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 9 Dec 2015 10:30:03 +0100 Subject: derivations: Determine what's built in 'check' mode. * guix/derivations.scm (substitution-oracle): Add #:mode parameter and honor it. (derivation-prerequisites-to-build): Likewise. [derivation-built?]: Take it into account. * guix/ui.scm (show-what-to-build): Add #:mode parameter. Pass it to 'substitute-oracle' and 'derivations-prerequisites-to-build'. * tests/derivations.scm ("derivation-prerequisites-to-build in 'check' mode"): 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 9fc96c71ae..1bbc93fe5c 100644 --- a/tests/derivations.scm +++ b/tests/derivations.scm @@ -670,6 +670,26 @@ (((? string? item)) (string=? item (derivation->output-path drv)))))))))) +(test-assert "derivation-prerequisites-to-build in 'check' mode" + (with-store store + (let* ((dep (build-expression->derivation store "dep" + `(begin ,(random-text) + (mkdir %output)))) + (drv (build-expression->derivation store "to-check" + '(mkdir %output) + #:inputs `(("dep" ,dep))))) + (build-derivations store (list drv)) + (delete-paths store (list (derivation->output-path dep))) + + ;; In 'check' mode, DEP must be rebuilt. + (and (null? (derivation-prerequisites-to-build store drv)) + (match (derivation-prerequisites-to-build store drv + #:mode (build-mode + check)) + ((input) + (string=? (derivation-input-path input) + (derivation-file-name dep)))))))) + (test-assert "build-expression->derivation with expression returning #f" (let* ((builder '(begin (mkdir %output) -- cgit v1.2.3