aboutsummaryrefslogtreecommitdiff
path: root/tests/import-utils.scm
Commit message (Collapse)AuthorAge
* tests: Fix ‘beautify-description’ test.Ludovic Courtès2024-06-13
| | | | | | | | | This is a followup to 510ad5d93c0ba6208aa42815863853ec522352e6. * tests/import-utils.scm ("beautify-description: transform fragment into sentence"): Fix. Change-Id: I331cb38a3460a024a789846772a074ba0b6c857c
* import: utils: End package descriptions with period.Herman Rimm2024-06-03
| | | | | | | | | | | | | | | | * guix/import/utils.scm (beautify-description): Append period to last words which do not end with one. * tests/crate.scm: Append period to descriptions. * tests/elm.scm: Append period to descriptions. * tests/gem.scm: Append period to descriptions. * tests/hexpm.scm: Append period to descriptions. * tests/minetest.scm: Append period to descriptions. * tests/pypi.scm: Append period to descriptions. * tests/import-utils.scm ("beautify-description: transform fragment into sentence"): Likewise. Change-Id: I0b12c4d94cb26cf62fab5b7cbf7885e66ff6c10f Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* import-utils: Do not include punctuation when wrapping in @code{}.Ricardo Wurmus2023-08-28
| | | | | * guix/import/utils.scm (beautify-description): Exclude punctuation. * tests/import-utils.scm: Add new test.
* import/utils: beautify-description: Wrap class names in @code{...}.Ricardo Wurmus2023-07-19
| | | | | | * guix/import/utils.scm (beautify-description): Add procedure to wrap words in @code{...} markup. * tests/import-utils.scm: Add two tests.
* packages: Remove 'origin-sha256' procedure.Bruno Victal2023-04-07
| | | | | | | | * guix/packages.scm (origin-sha256): Remove procedure. * tests/import-utils.scm (test-import-utils) [alist->package with explicit source]: Use content-hash-value. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* tests: import-utils: Ignore extra keyword arguments.Ricardo Wurmus2022-12-31
| | | | | | * tests/import-utils.scm ("recursive-import", "recursive-import: skip false packages (toplevel)", "recursive-import: skip false packages (dependency)"): Do not try to match all arguments.
* import/utils: spdx-string->license: Support '+' operator.Philip McGrath2022-11-18
| | | | | | | | | | | | | | Previously, '+' was supported only via special cases for deprecated GNU identifiers like 'GPL-N+'. This commit adds support for other uses of '+', such as 'AFL-2.0+' and 'LPPL-1.0+'. Strictly speaking, '+' is an operator, not part of the SPDX license identifier, but it is useful to handle it here. * guix/import/utils.scm (spdx-string->license): Support '+' operator. * tests/import-utils.scm ("spdx-string->license"): Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* import/utils: spdx-string->license: Match case-insensitively.Philip McGrath2022-11-18
| | | | | | | | | | | | SPDX specifies that license identifiers (unlike the 'AND', 'OR', and 'WITH' operators) are matched case-insensitively. * guix/import/utils.scm (%spdx-license-identifiers): New variable. (spdx-string->license): Search in '%spdx-license-identifiers' using 'string-ci=?'. * tests/import-utils.scm ("spdx-string->license"): New test. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* tests: Add new test cases for beautify-description.Ricardo Wurmus2022-10-05
| | | | | | * tests/import-utils.scm ("beautify-description: use double spacing"): Update. ("beautify-description: remove single quotes", "beautify-description: escape @"): New tests.
* import/utils: alist->package: Include properties.itd2022-09-29
| | | | | | | | * guix/import/utils.scm (alist->package): Process properties field in input data and include it in the generated package. * tests/import-utils.scm ("alist->package with properties"): New test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* import: utils: Skip not found packages.Sarah Morgensen2021-09-01
| | | | | | | | * guix/import/utils.scm (recursive-import): Skip packages when the package returned by 'repo->guix-package' is false. * tests/import-utils.scm: New tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* import/utils: alist->package: Handle SPDX license names only as fallback.Ricardo Wurmus2020-12-27
| | | | | | | | | Fixes <https://bugs.gnu.org/45453>. * guix/import/utils.scm (alist->package): Find plain license names in (guix licenses) first, and only fall back to SPDX names on error. * tests/import-utils.scm ("alist->package with SPDX license name 1/2", "alist->package with SPDX license name 2/2"): New tests.
* import: utils: 'recursive-import' accepts an optional version parameter.Martin Becze2020-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds a key VERSION to 'recursive-import' and moves the parameter REPO to a key. This also changes all the places that rely on 'recursive-import'. * guix/import/utils.scm (recursive-import): Add the VERSION key. Make REPO a key. (package->definition): Add optional 'append-version?'. * guix/scripts/import/crate.scm (guix-import-crate): Add the VERSION key. * guix/import/crate.scm (crate->guix-package): Add the VERSION key. (crate-recursive-import): Pass VERSION to recursive-import, remove now unnecessary code. * guix/import/cran.scm (cran->guix-package, cran-recursive-import): Change the REPO parameter to a key. * guix/import/elpa.scm (elpa->guix-package, elpa-recursive-import): Likewise. * guix/import/gem.scm (gem->guix-package, recursive-import): Likewise. * guix/import/opam.scm (opam-recurive-import): Likewise. * guix/import/pypi.scm (pypi-recursive-import): Likewise. * guix/import/stackage.scm (stackage-recursive-import): Likewise. * guix/scripts/import/cran.scm (guix-import-cran): Likewise. * guix/scripts/import/elpa.scm (guix-import-elpa): Likewise. * tests/elpa.scm (eval-test-with-elpa): Likewise. * tests/import-utils.scm (recursive-import): Likewise. Co-authored-by: Hartmut Goebel <h.goebel@crazy-compilers.com>
* import: utils: 'recursive-import' returns a list rather than a stream.Ludovic Courtès2019-12-11
| | | | | | | | | | | | | | | | | * guix/import/utils.scm (recursive-import): Remove 'list->stream' call. * guix/scripts/import/cran.scm (guix-import-cran): Remove 'stream->list' call. * guix/scripts/import/crate.scm (guix-import-crate): Likewise. * guix/scripts/import/elpa.scm (guix-import-elpa): Likewise. * guix/scripts/import/gem.scm (guix-import-gem): Likewise. * guix/scripts/import/hackage.scm (guix-import-hackage): Likewise. * guix/scripts/import/opam.scm (guix-import-opam): Likewise. * guix/scripts/import/pypi.scm (guix-import-pypi): Likewise. * guix/scripts/import/stackage.scm (guix-import-stackage): Likewise. * tests/gem.scm ("gem-recursive-import"): Likewise. * tests/import-utils.scm ("recursive-import"): Likewise. Co-authored-by: Brian Leung <bkleung89@gmail.com>
* import: utils: 'recursive-import' returns packages in topological order.Ludovic Courtès2019-12-11
| | | | | | | | | | | | | | | | | | * guix/import/utils.scm (topological-sort): New procedure. (recursive-import): Rewrite to use it. * tests/import-utils.scm ("recursive-import"): New test. * guix/import/cran.scm (cran->guix-package): Always return two values. * guix/scripts/import/cran.scm (guix-import-cran): Remove 'reverse' call on 'cran-recursive-import' result. * guix/scripts/import/crate.scm (guix-import-crate): Likewise. * guix/scripts/import/elpa.scm (guix-import-elpa): Likewise. * guix/scripts/import/gem.scm (guix-import-gem): Likewise. * guix/scripts/import/hackage.scm (guix-import-hackage): Likewise. * guix/scripts/import/opam.scm (guix-import-opam): Likewise. * guix/scripts/import/pypi.scm (guix-import-pypi): Likewise. * guix/scripts/import/stackage.scm (guix-import-stackage): Likewise. * tests/gem.scm ("gem-recursive-import"): Change the order of package expressions accordingly.
* maint: Switch to Guile-JSON 3.x.Ludovic Courtès2019-07-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Guile-JSON 3.x is incompatible with Guile-JSON 1.x, which we relied on until now: it maps JSON dictionaries to alists (instead of hash tables), and JSON arrays to vectors (instead of lists). This commit is about adjusting all the existing code to this new mapping. * m4/guix.m4 (GUIX_CHECK_GUILE_JSON): New macro. * configure.ac: Use it. * doc/guix.texi (Requirements): Mention the Guile-JSON version. * guix/git-download.scm (git-fetch)[guile-json]: Use GUILE-JSON-3. * guix/import/cpan.scm (string->license): Expect vectors instead of lists. (module->dist-name): Use 'json-fetch' instead of 'json-fetch-alist'. (cpan-fetch): Likewise. * guix/import/crate.scm (crate-fetch): Likewise, and call 'vector->list' for DEPS. * guix/import/gem.scm (rubygems-fetch): Likewise. * guix/import/json.scm (json-fetch-alist): Remove. * guix/import/pypi.scm (pypi-fetch): Use 'json-fetch' instead of 'json-fetch-alist'. (latest-source-release, latest-wheel-release): Call 'vector->list' on RELEASES. * guix/import/stackage.scm (stackage-lts-info-fetch): Use 'json-fetch' instead of 'json-fetch-alist'. (lts-package-version): Use 'vector->list'. * guix/import/utils.scm (hash-table->alist): Remove. (alist->package): Pass 'vector->list' on the inputs fields, and default to the empty vector. * guix/scripts/import/json.scm (guix-import-json): Remove call to 'hash-table->alist'. * guix/swh.scm (define-json-reader): Expect pair? or null? instead of hash-table?. [extract-field]: Use 'assoc-ref' instead of 'hash-ref'. (json->branches): Use 'map' instead of 'hash-map->list'. (json->checksums): Likewise. (json->directory-entries, origin-visits): Call 'vector->list' on the result of 'json->scm'. * tests/import-utils.scm ("alist->package with dependencies"): New test. * gnu/installer.scm (build-compiled-file)[builder]: Use GUILE-JSON-3. * gnu/installer.scm (installer-program)[installer-builder]: Likewise. * gnu/installer/locale.scm (iso639->iso639-languages): Use 'assoc-ref' instead of 'hash-ref', and pass vectors through 'vector->list'. (iso3166->iso3166-territories): Likewise. * gnu/system/vm.scm (system-docker-image)[build]: Use GUILE-JSON-3. * guix/docker.scm (manifest, config): Adjust for Guile-JSON 3. * guix/scripts/pack.scm (docker-image)[build]: Use GUILE-JSON-3. * guix/import/github.scm (fetch-releases-or-tags): Update docstring. (latest-released-version): Use 'assoc-ref' instead of 'hash-ref'. Pass the result of 'fetch-releases-or-tags' to 'vector->list'. * guix/import/launchpad.scm (latest-released-version): Likewise.
* import: utils: 'alist->package' allows false license.Ludovic Courtès2018-02-16
| | | | | | | | | | Reported by <pkill9@runbox.com>. Fixes <https://bugs.gnu.org/30470>. * guix/import/utils.scm (alist->package): Check whether 'license' is false and set the 'license' field to #f in this case. * tests/import-utils.scm ("alist->package with false license"): New test.
* import: Use a 'file://' URL in 'alist->package' test.Ludovic Courtès2017-10-06
| | | | | * tests/import-utils.scm ("alist->package with simple source"): Use a 'file://' URL.
* import: Add generic data to package converter.Ricardo Wurmus2017-09-28
| | | | | | * guix/import/utils.scm (build-system-modules, lookup-build-system-by-name, specs->package-lists, source-spec->object, alist->package): New procedures. * tests/import-utils.scm: Add tests for alist->package.
* import: utils: Refactor license->symbol.David Craven2016-09-28
| | | | | * guix/import/utils.scm (license->symbol): Work for all licenses. * tests/import-utils.scm (license->symbol): Add test.
* build: Add a Guile custom test driver using SRFI-64.Mathieu Lirzin2016-04-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before that '.log' files for scheme tests were fragmented and not included in test-suite.log. This unifies the semantics of SRFI-64 API with Automake test suite. * build-aux/test-driver.scm: New file. * Makefile.am (SCM_LOG_DRIVER, AM_SCM_LOG_DRIVER_FLAGS): New variables. (SCM_LOG_COMPILER, AM_SCM_LOG_FLAGS): Delete variables. (AM_TESTS_ENVIRONMENT): Set GUILE_AUTO_COMPILE to 0. * test-env.in: Silence guix-daemon. * doc/guix.texi (Running the Test Suite): Describe how to display the detailed results. Bug reports require only 'test-suite.log' file. * tests/base32.scm, tests/build-utils.scm, tests/builders.scm, tests/challenge.scm, tests/cpan.scm, tests/cpio.scm, tests/cran.scm, tests/cve.scm, tests/derivations.scm, tests/elpa.scm, tests/file-systems.scm, tests/gem.scm, tests/gexp.scm, tests/gnu-maintenance.scm, tests/grafts.scm, tests/graph.scm, tests/gremlin.scm, tests/hackage.scm, tests/hash.scm, tests/import-utils.scm, tests/lint.scm, tests/monads.scm, tests/nar.scm, tests/packages.scm, tests/pk-crypto.scm, tests/pki.scm, tests/profiles.scm, tests/publish.scm, tests/pypi.scm, tests/records.scm, tests/scripts-build.scm, tests/scripts.scm, tests/services.scm, tests/sets.scm, tests/size.scm, tests/snix.scm, tests/store.scm, tests/substitute.scm, tests/syscalls.scm, tests/system.scm, tests/ui.scm, tests/union.scm, tests/upstream.scm, tests/utils.scm: Don't exit at the end of test groups. * tests/containers.scm: Likewise. Use 'test-skip' instead of exiting with error code 77.
* tests: Move beatify-description tests to import-tests.Ben Woodcroft2016-01-20
Fixes <http://bugs.gnu.org/22391>. * tests/cran.scm (beautify-description: use double spacing, beautify-description: transform fragment into sentence). Move from here ... * tests/import-utils.scm: ... to here. New file. * Makefile.am (SCM_TESTS): Add import-utils.