From c5a4a92f1a796e342b7db4c458f1fdb61ffc8d40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 8 Nov 2017 13:33:25 +0100 Subject: gnu: Improve error reporting of the use-.*modules macros. Suggested by Julien Lepiller and myglc2 at . * gnu.scm (%try-use-modules): New procedure. (package-module-hint, service-module-hint): New procedures. (try-use-modules): New macro. (use-package-modules, use-service-modules, use-system-modules): Use it. * tests/guix-system.sh: Test it. --- tests/guix-system.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tests') diff --git a/tests/guix-system.sh b/tests/guix-system.sh index 31ee637133..1346d8d5a8 100644 --- a/tests/guix-system.sh +++ b/tests/guix-system.sh @@ -68,6 +68,34 @@ else fi +# Reporting of module not found errors. + +cat > "$tmpfile" < "$errorfile" +then false +else + grep "$tmpfile:3:2: .*module .*openssh.*not found" "$errorfile" + grep "Try.*use-service-modules ssh" "$errorfile" +fi + +cat > "$tmpfile" < "$errorfile" +then false +else + grep "$tmpfile:3:2: .*module .*qemu.*not found" "$errorfile" + grep "Try.*use-package-modules virtualization" "$errorfile" +fi + # Reporting of unbound variables. cat > "$tmpfile" <