summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-10-22 23:30:35 +0200
committerLudovic Courtès <ludo@gnu.org>2012-10-24 00:09:25 +0200
commitd90248844bc6e4400c999047a292c318a1cf1103 (patch)
tree8234213e55d14acd327fa5f62440c4be0028e2ef /tests
parentd398e2c2426cd50a97603b0be6da999e67947def (diff)
downloadguix-d90248844bc6e4400c999047a292c318a1cf1103.tar.gz
derivations: Compile the #:modules passed to `build-expression->derivation'.
* guix/derivations.scm (imported-files)[parent-dirs]: Move to...
  (parent-directories): ... here.  New procedure.
  (compiled-modules): New procedure.
  (build-expression->derivation): Use it.

* tests/derivations.scm ("build-expression->derivation with modules"):
  New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/derivations.scm17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/derivations.scm b/tests/derivations.scm
index 097b9d7d28..95507aa780 100644
--- a/tests/derivations.scm
+++ b/tests/derivations.scm
@@ -324,6 +324,23 @@
                               get-bytevector-all))))
                   files)))))
 
+(test-assert "build-expression->derivation with modules"
+  (let* ((builder  `(begin
+                      (use-modules (guix build utils))
+                      (let ((out (assoc-ref %outputs "out")))
+                        (mkdir-p (string-append out "/guile/guix/nix"))
+                        #t)))
+         (drv-path (build-expression->derivation %store
+                                                 "test-with-modules"
+                                                 (%current-system)
+                                                 builder '()
+                                                 #:modules
+                                                 '((guix build utils)))))
+    (and (build-derivations %store (list drv-path))
+         (let* ((p (derivation-path->output-path drv-path))
+                (s (stat (string-append p "/guile/guix/nix"))))
+           (eq? (stat:type s) 'directory)))))
+
 (test-skip (if (false-if-exception (getaddrinfo "ftp.gnu.org" "http"))
                0
                1))