From d26e19671e2a50a25d37357aba301bef5df1818e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 22 Mar 2016 15:00:53 +0100 Subject: derivations: Raise an error when a module file is not found. Suggested by Jookia. * guix/derivations.scm (&file-search-error): New error condition. (search-path*): Raise it when 'search-path' returns #f. * guix/gexp.scm (search-path*): Remove. * guix/ui.scm (call-with-error-handling): Add case for 'file-search-error?'. * tests/derivations.scm ("build-expression->derivation and invalid module name"): New test. --- tests/derivations.scm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/derivations.scm') diff --git a/tests/derivations.scm b/tests/derivations.scm index 4d3b82fe1a..a52142e0f1 100644 --- a/tests/derivations.scm +++ b/tests/derivations.scm @@ -570,6 +570,15 @@ (test-skip (if (%guile-for-build) 0 8)) +(test-equal "build-expression->derivation and invalid module name" + '(file-search-error "guix/module/that/does/not/exist.scm") + (guard (c ((file-search-error? c) + (list 'file-search-error + (file-search-error-file-name c)))) + (build-expression->derivation %store "foo" #t + #:modules '((guix module that + does not exist))))) + (test-assert "build-expression->derivation and derivation-prerequisites" (let ((drv (build-expression->derivation %store "fail" #f))) (any (match-lambda -- cgit v1.2.3