summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/derivations.scm17
-rw-r--r--tests/gexp.scm34
2 files changed, 34 insertions, 17 deletions
diff --git a/tests/derivations.scm b/tests/derivations.scm
index 80aabad3a8..e23bdeed77 100644
--- a/tests/derivations.scm
+++ b/tests/derivations.scm
@@ -670,23 +670,6 @@
(let ((p (derivation->output-path drv)))
(string-contains (call-with-input-file p read-line) "GNU")))))
-(test-assert "imported-files"
- (let* ((files `(("x" . ,(search-path %load-path "ice-9/q.scm"))
- ("a/b/c" . ,(search-path %load-path
- "guix/derivations.scm"))
- ("p/q" . ,(search-path %load-path "guix.scm"))
- ("p/z" . ,(search-path %load-path "guix/store.scm"))))
- (drv (imported-files %store files)))
- (and (build-derivations %store (list drv))
- (let ((dir (derivation->output-path drv)))
- (every (match-lambda
- ((path . source)
- (equal? (call-with-input-file (string-append dir "/" path)
- get-bytevector-all)
- (call-with-input-file source
- get-bytevector-all))))
- files)))))
-
(test-assert "build-expression->derivation with modules"
(let* ((builder `(begin
(use-modules (guix build utils))
diff --git a/tests/gexp.scm b/tests/gexp.scm
index 03722e4669..68c470d3b6 100644
--- a/tests/gexp.scm
+++ b/tests/gexp.scm
@@ -360,6 +360,40 @@
(string=? (readlink (string-append out "/" two "/one"))
one)))))))
+(test-assertm "imported-files"
+ (mlet* %store-monad
+ ((files -> `(("x" . ,(search-path %load-path "ice-9/q.scm"))
+ ("a/b/c" . ,(search-path %load-path
+ "guix/derivations.scm"))
+ ("p/q" . ,(search-path %load-path "guix.scm"))
+ ("p/z" . ,(search-path %load-path "guix/store.scm"))))
+ (drv (imported-files files)))
+ (mbegin %store-monad
+ (built-derivations (list drv))
+ (let ((dir (derivation->output-path drv)))
+ (return
+ (every (match-lambda
+ ((path . source)
+ (equal? (call-with-input-file (string-append dir "/" path)
+ get-bytevector-all)
+ (call-with-input-file source
+ get-bytevector-all))))
+ files))))))
+
+(test-assertm "gexp->derivation #:modules"
+ (mlet* %store-monad
+ ((build -> #~(begin
+ (use-modules (guix build utils))
+ (mkdir-p (string-append #$output "/guile/guix/nix"))
+ #t))
+ (drv (gexp->derivation "test-with-modules" build
+ #:modules '((guix build utils)))))
+ (mbegin %store-monad
+ (built-derivations (list drv))
+ (let* ((p (derivation->output-path drv))
+ (s (stat (string-append p "/guile/guix/nix"))))
+ (return (eq? (stat:type s) 'directory))))))
+
(test-assertm "gexp->derivation #:references-graphs"
(mlet* %store-monad
((one (text-file "one" "hello, world"))