aboutsummaryrefslogtreecommitdiff
path: root/tests/guix-system.sh
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-05-25 18:25:19 +0200
committerLudovic Courtès <ludo@gnu.org>2015-05-25 21:34:23 +0200
commit2abcc97fd1867176d5530f988ab34c26530de2c2 (patch)
treef83211356ce43e7496d00495966e616cec93b229 /tests/guix-system.sh
parentfbb25e5651d4bd084b2af41078cffd9254d8f8a7 (diff)
downloadguix-2abcc97fd1867176d5530f988ab34c26530de2c2.tar
guix-2abcc97fd1867176d5530f988ab34c26530de2c2.tar.gz
ui: Auto-compile user code, and improve error reporting.
Reported by Christian Grothoff. * guix/ui.scm (load*): Add 'frame-with-source'. Set %load-should-auto-compile. Change error handle to just (exit 1). Add pre-unwind handler to capture the stack and call 'report-load-error'. (report-load-error): Add optional 'frame' parameter and pass it to 'display-error'. * tests/guix-system.sh: Add "unbound variable" test.
Diffstat (limited to 'tests/guix-system.sh')
-rw-r--r--tests/guix-system.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/guix-system.sh b/tests/guix-system.sh
index 7008ef8031..4289db2390 100644
--- a/tests/guix-system.sh
+++ b/tests/guix-system.sh
@@ -45,6 +45,32 @@ else
fi
+# Reporting of unbound variables.
+
+cat > "$tmpfile" <<EOF
+(use-modules (gnu)) ; 1
+(use-service-modules networking) ; 2
+
+(operating-system ; 4
+ (host-name "antelope") ; 5
+ (timezone "Europe/Paris") ; 6
+ (locale "en_US.UTF-8") ; 7
+
+ (bootloader (GRUB-config (device "/dev/sdX"))) ; 9
+ (file-systems (cons (file-system
+ (device "root")
+ (title 'label)
+ (mount-point "/")
+ (type "ext4"))
+ %base-file-systems)))
+EOF
+
+if guix system build "$tmpfile" -n 2> "$errorfile"
+then false
+else
+ grep "$tmpfile:9:.*[Uu]nbound variable.*GRUB-config" "$errorfile"
+fi
+
# Reporting of duplicate service identifiers.
cat > "$tmpfile" <<EOF