diff options
author | Ludovic Courtès <ludo@gnu.org> | 2019-06-17 22:48:44 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2019-06-18 16:25:09 +0200 |
commit | 5c7f87881a52a6424fc6722376b990284a06de5a (patch) | |
tree | 826acfdf1b9e970e44ee8649a6410efc055b863e /tests | |
parent | a32e3b90787ab3d221fb1b8d0bfd9c519a874230 (diff) | |
download | guix-5c7f87881a52a6424fc6722376b990284a06de5a.tar guix-5c7f87881a52a6424fc6722376b990284a06de5a.tar.gz |
tests: Avoid 'delete-paths' calls for 'derivation-prerequisites-to-build'.
* tests/derivations.scm ("derivation-prerequisites-to-build when outputs
already present"): Insert random text in BUILDER, and remove two calls
to 'delete-paths'. Use 'derivation->output-path' for INPUT-PATH instead
of an old idiom.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/derivations.scm | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/derivations.scm b/tests/derivations.scm index c421d094a4..93f4cdd8ee 100644 --- a/tests/derivations.scm +++ b/tests/derivations.scm @@ -816,20 +816,17 @@ (null? (derivation-prerequisites-to-build %store drv)))) (test-assert "derivation-prerequisites-to-build when outputs already present" - (let* ((builder '(begin (mkdir %output) #t)) + (let* ((builder `(begin ,(random-text) (mkdir %output) #t)) (input-drv (build-expression->derivation %store "input" builder)) - (input-path (derivation-output-path - (assoc-ref (derivation-outputs input-drv) - "out"))) + (input-path (derivation->output-path input-drv)) (drv (build-expression->derivation %store "something" builder #:inputs `(("i" ,input-drv)))) (output (derivation->output-path drv))) - ;; Make sure these things are not already built. - (when (valid-path? %store input-path) - (delete-paths %store (list input-path))) - (when (valid-path? %store output) - (delete-paths %store (list output))) + ;; Assume these things are not already built. + (when (or (valid-path? %store input-path) + (valid-path? %store output)) + (error "things already built" input-drv)) (and (equal? (map derivation-input-path (derivation-prerequisites-to-build %store drv)) |