aboutsummaryrefslogtreecommitdiff
path: root/tests/modules.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2017-05-27 03:55:24 +0200
committerMarius Bakke <mbakke@fastmail.com>2017-05-27 03:55:24 +0200
commit9df24909e252980c2393d2baaa617c30db8c9dd8 (patch)
treea32bd0d0b993f05a51bd8f49993be99c0770262d /tests/modules.scm
parentae40e02cd68d4e0ab10690bd4e59c698df472857 (diff)
parentfdabfdbf8d5e179b2726ae69ff8aec48b0504788 (diff)
downloadguix-9df24909e252980c2393d2baaa617c30db8c9dd8.tar
guix-9df24909e252980c2393d2baaa617c30db8c9dd8.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'tests/modules.scm')
-rw-r--r--tests/modules.scm25
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/modules.scm b/tests/modules.scm
index 04945e531b..57019c600c 100644
--- a/tests/modules.scm
+++ b/tests/modules.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -19,7 +19,9 @@
(define-module (test-modules)
#:use-module (guix modules)
#:use-module ((guix build-system gnu) #:select (%gnu-build-system-modules))
+ #:use-module ((guix utils) #:select (call-with-temporary-directory))
#:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-34)
#:use-module (srfi srfi-64))
(test-begin "modules")
@@ -42,4 +44,25 @@
(live-module-closure '((gnu build vm)))
(source-module-closure '((gnu build vm)))))
+(test-equal "&missing-dependency-error"
+ '(something that does not exist)
+ (call-with-temporary-directory
+ (lambda (directory)
+ (call-with-output-file (string-append directory "/foobar.scm")
+ (lambda (port)
+ (write '(define-module (foobar)
+ #:use-module (something that does not exist))
+ port)))
+
+ (call-with-output-file (string-append directory "/baz.scm")
+ (lambda (port)
+ (write '(define-module (baz)
+ #:use-module (foobar))
+ port)))
+
+ (guard (c ((missing-dependency-error? c)
+ (missing-dependency-module c)))
+ (source-module-closure '((baz)) (list directory)
+ #:select? (const #t))))))
+
(test-end)