From 4d59596a1c5f6b20870e619cbf67068ac7dd64ff Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 7 Nov 2021 15:56:19 +0100 Subject: ui: 'load*' correctly reports 'read-error' in all cases. Previously, 'read-error' exceptions other than "missing closing paren" would not be reported; instead, we'd directly call (exit 1) without printing anything. Fixes . Reported by Alice BRENON . * guix/ui.scm (report-load-error): Report the error without re-throwing upon 'read-error'. * tests/guix-build.sh: Add test. --- tests/guix-build.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/guix-build.sh b/tests/guix-build.sh index e20702c521..46c8afc901 100644 --- a/tests/guix-build.sh +++ b/tests/guix-build.sh @@ -1,5 +1,5 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2012, 2013, 2014, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès +# Copyright © 2012, 2013, 2014, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès # Copyright © 2020 Marius Bakke # Copyright © 2021 Chris Marusich # @@ -77,6 +77,16 @@ module_dir="t-guix-build-$$" mkdir "$module_dir" trap "rm -rf $module_dir" EXIT +# Check error reporting for '-f'. +cat > "$module_dir/foo.scm" < "$module_dir/stderr" +grep "read error" "$module_dir/stderr" +rm "$module_dir/stderr" "$module_dir/foo.scm" + +# Check 'GUIX_PACKAGE_PATH' & co. cat > "$module_dir/foo.scm"<