diff options
author | Chris Marusich <cmmarusich@gmail.com> | 2019-05-06 01:51:30 -0700 |
---|---|---|
committer | Chris Marusich <cmmarusich@gmail.com> | 2019-05-09 00:10:34 -0700 |
commit | 387e6b9e340ce4b401f220f72881415623a466f7 (patch) | |
tree | cc75376dfc2ae5948a16cb604cda50eec525587a /tests | |
parent | 063edf928a3ea0e9c423707926f30502ab56fe67 (diff) | |
download | patches-387e6b9e340ce4b401f220f72881415623a466f7.tar patches-387e6b9e340ce4b401f220f72881415623a466f7.tar.gz |
ui: Make package outputs searchable.
* guix/ui.scm (relevance): Allow the "field" procedure of a metric to
return a list, and handle that case appropriately. Update docstring.
(%package-metrics): Add a metric for package outputs.
* guix/scripts/package.scm (find-packages-by-description): Update
docstring.
* tests/guix-package.sh: Add a test case to verify that package outputs are
included in search results.
Co-authored-by: Tobias Geerinckx-Rice <me@tobias.gr>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/guix-package.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/guix-package.sh b/tests/guix-package.sh index 0d60481895..262d29bd59 100644 --- a/tests/guix-package.sh +++ b/tests/guix-package.sh @@ -398,3 +398,28 @@ else grep "manifest.scm:[1-3]:.*wonderful-package.*: unbound variable" \ "$module_dir/stderr" fi + +# Verify that package outputs are included in search results. +rm -rf "$module_dir" +mkdir "$module_dir" +cat > "$module_dir/foo.scm"<<EOF +(define-module (foo) + #:use-module (guix packages) + #:use-module (guix build-system trivial)) + +(define-public dummy-package + (package + (name "dummy-package") + (version "dummy-version") + (outputs '("out" "dummy-output")) + (source #f) + ;; Without a real build system, the "guix pacakge -s" command will fail. + (build-system trivial-build-system) + (synopsis "dummy-synopsis") + (description "dummy-description") + (home-page "https://dummy-home-page") + (license #f))) +EOF +guix package -L "$module_dir" -s dummy-output > /tmp/out +test "`guix package -L "$module_dir" -s dummy-output | grep ^name:`" = "name: dummy-package" +rm -rf "$module_dir" |