summary refs log tree commit diff
path: root/tests/derivations.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/derivations.scm')
-rw-r--r--tests/derivations.scm15
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/derivations.scm b/tests/derivations.scm
index 25ba4c9fa0..b0175d9fc5 100644
--- a/tests/derivations.scm
+++ b/tests/derivations.scm
@@ -815,20 +815,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))