summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2017-03-30 22:59:53 +0200
committerMarius Bakke <mbakke@fastmail.com>2017-03-30 22:59:53 +0200
commit84157bb8bf2c610584e0836047da4c710f8eaf76 (patch)
treebe5d8c7238e32802221db55a3ee83e7f6a58affb /tests
parentfa63939acba69e11df44073a7eb687bd2ba48349 (diff)
parent03d0aa8b22223b67ec9bbd363c4d5800efdbaf82 (diff)
downloadguix-84157bb8bf2c610584e0836047da4c710f8eaf76.tar.gz
Merge branch 'master' into core-updates
Most conflicts are from 6fd52309b8f52c9bb59fccffac53e029ce94b698.
Diffstat (limited to 'tests')
-rw-r--r--tests/derivations.scm29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/derivations.scm b/tests/derivations.scm
index 3fbfec3793..75c8d1dfb1 100644
--- a/tests/derivations.scm
+++ b/tests/derivations.scm
@@ -888,6 +888,35 @@
               (string=? (derivation-input-path input)
                         (derivation-file-name dep))))))))
 
+(test-assert "substitution-oracle and #:substitute? #f"
+  (with-store store
+    (let* ((dep   (build-expression->derivation store "dep"
+                                                `(begin ,(random-text)
+                                                        (mkdir %output))))
+           (drv   (build-expression->derivation store "not-subst"
+                                                `(begin ,(random-text)
+                                                        (mkdir %output))
+                                                #:substitutable? #f
+                                                #:inputs `(("dep" ,dep))))
+           (query #f))
+      (define (record-substitutable-path-query store paths)
+        (when query
+          (error "already called!" query))
+        (set! query paths)
+        '())
+
+      (mock ((guix store) substitutable-paths
+             record-substitutable-path-query)
+
+            (let ((pred (substitution-oracle store (list drv))))
+              (pred (derivation->output-path drv))))
+
+      ;; Make sure the oracle didn't try to get substitute info for DRV since
+      ;; DRV is mark as non-substitutable.  Assume that GUILE-FOR-BUILD is
+      ;; already in store and thus not part of QUERY.
+      (equal? (pk 'query query)
+              (list (derivation->output-path dep))))))
+
 (test-assert "build-expression->derivation with expression returning #f"
   (let* ((builder  '(begin
                       (mkdir %output)