From c5a4a92f1a796e342b7db4c458f1fdb61ffc8d40 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès 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/guix-system.sh') 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" < Date: Fri, 10 Nov 2017 00:02:30 +0100 Subject: tests: Adjust to unbound-variable exception printer. * tests/guix-system.sh: Adjust unbound-variable test for commit dc856223f5eab57d8a4881782ec0f50abd12afa3. --- tests/guix-system.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/guix-system.sh') diff --git a/tests/guix-system.sh b/tests/guix-system.sh index 1346d8d5a8..4bb866adfa 100644 --- a/tests/guix-system.sh +++ b/tests/guix-system.sh @@ -123,9 +123,9 @@ else then # FIXME: With Guile 2.2.0 the error is reported on line 4. # See . - grep "$tmpfile:[49]:.*[Uu]nbound variable.*GRUB-config" "$errorfile" + grep "$tmpfile:[49]:[0-9]: GRUB-config.*[Uu]nbound variable" "$errorfile" else - grep "$tmpfile:9:.*[Uu]nbound variable.*GRUB-config" "$errorfile" + grep "$tmpfile:9:[0-9]: GRUB-config.*[Uu]nbound variable" "$errorfile" fi fi -- cgit v1.2.3