aboutsummaryrefslogtreecommitdiff
path: root/tests/guix-build.sh
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-07-19 23:48:09 +0200
committerLudovic Courtès <ludo@gnu.org>2019-07-20 01:32:17 +0200
commita2a94b6e58e5120462d6861bdf72efa2170bfd73 (patch)
treef676bd14b7ed98f6bdb2e0eaaeeaefd058c77235 /tests/guix-build.sh
parentddc586ea5c1fd65e29d626c54da1d192c71b6750 (diff)
downloadguix-a2a94b6e58e5120462d6861bdf72efa2170bfd73.tar
guix-a2a94b6e58e5120462d6861bdf72efa2170bfd73.tar.gz
ui: 'warn-about-load-error' warns about file/module name mismatches.
* guix/discovery.scm (scheme-modules): Rename the inner 'file' to 'relative'. Pass FILE as an addition argument to WARN. * guix/ui.scm (warn-about-load-error): Add 'module' argument (actually, what was called 'file' really contained a module name.) Call 'check-module-matches-file' in the catch-all error case. (check-module-matches-file): New procedure. * tests/guix-build.sh: Test it.
Diffstat (limited to 'tests/guix-build.sh')
-rw-r--r--tests/guix-build.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/guix-build.sh b/tests/guix-build.sh
index 63a9fe68da..d16b92d189 100644
--- a/tests/guix-build.sh
+++ b/tests/guix-build.sh
@@ -164,6 +164,17 @@ grep "unbound" "$module_dir/err" # actual error
grep "forget.*(gnu packages base)" "$module_dir/err" # hint
rm -f "$module_dir"/*
+# Wrong 'define-module' clause reported by 'warn-about-load-error'.
+cat > "$module_dir/foo.scm" <<EOF
+(define-module (something foo)
+ #:use-module (guix)
+ #:use-module (gnu))
+EOF
+guix build guile-bootstrap -n 2> "$module_dir/err"
+grep "does not match file name" "$module_dir/err"
+
+rm "$module_dir"/*
+
# Should all return valid log files.
drv="`guix build -d -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'`"
out="`guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'`"
@@ -265,6 +276,7 @@ cat > "$module_dir/gexp.scm"<<EOF
EOF
guix build --file="$module_dir/gexp.scm" -d
guix build --file="$module_dir/gexp.scm" -d | grep 'gexp\.drv'
+rm "$module_dir"/*.scm
# Using 'GUIX_BUILD_OPTIONS'.
GUIX_BUILD_OPTIONS="--dry-run --no-grafts"