summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-09-18 14:55:44 +0200
committerLudovic Courtès <ludo@gnu.org>2019-09-18 23:08:28 +0200
commitf9c0400392843540a87985a67ffb9fb6e4dbc2fa (patch)
tree66e294cc022f4383d2f64b7dbfc9ccd567082ef4 /tests
parentcf48ea9539020bd6300033a8910ca951225582e6 (diff)
downloadpatches-f9c0400392843540a87985a67ffb9fb6e4dbc2fa.tar
patches-f9c0400392843540a87985a67ffb9fb6e4dbc2fa.tar.gz
guix package: "guix package -f FILE" ensures FILE returns a package.
* guix/scripts/package.scm (options->installable): Add clause for 'install option with a non-package object. * tests/guix-package.sh: Add test.
Diffstat (limited to 'tests')
-rw-r--r--tests/guix-package.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/guix-package.sh b/tests/guix-package.sh
index 79d6ec65e4..79e89286f1 100644
--- a/tests/guix-package.sh
+++ b/tests/guix-package.sh
@@ -331,6 +331,17 @@ cat > "$module_dir/package.scm"<<EOF
EOF
guix package --bootstrap --install-from-file="$module_dir/package.scm"
+# Make sure an error is raised if the file doesn't return a package.
+cat > "$module_dir/package.scm"<<EOF
+(use-modules (gnu packages base))
+
+(define my-package coreutils) ;returns *unspecified*
+EOF
+if guix package --bootstrap --install-from-file="$module_dir/package.scm"
+then false; else true; fi
+
+rm "$module_dir/package.scm"
+
# This one should not show up in searches since it's no supported on the
# current system.
test "`guix package -A super-non-portable-emacs`" = ""