summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2023-09-15tests: Fix "package-transitive-supported-systems, implicit inputs".Janneke Nieuwenhuizen
This is a follow-up to commit 0e08ad7f19d5b29a4883468552b5d213a7bdb66e gnu: linux-libre-headers: Remove i586-gnu from supported-systems. See also <https://issues.guix.gnu.org/65755>. * tests/packages.scm ("package-transitive-supported-systems, implicit inputs"): Filter expectiation with target-linux?, as %current-system is linux. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2023-09-08lint: Check that (cc-for-target) and friends are used.Maxime Devos
"CC=gcc" is almost always incorrect; people often just don't notice the incorrectness because they are compiling natively. For an exception, see tzdata. "guix style" partially made things worse, so I partially ignored it. * guix/lint.scm (check-compiler-for-target): New linter. * tests/lint.scm ("compiler-for-target: unconditional CC=gcc is unacceptable") ("compiler-for-target: looks through G-expressions") ("compiler-for-target: (cc-for-target) is acceptable") ("compiler-for-target: CC=gcc is acceptable when target=#false"): Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-11-15locate: Accept ‘--clear’ without additional arguments.Ludovic Courtès
Fixes a bug whereby ‘guix locate --clear’ would end with the “no files to search for” error. Fixes <https://issues.guix.gnu.org/66799>. * guix/scripts/locate.scm (guix-locate): Do not emit “no files to search for” error when 'clear? is set in OPTS. * tests/guix-locate.sh: Test it. Reported-by: Maciej Kalandyk <m.kalandyk@outlook.com> Change-Id: Ib8fa125c18481d7f5408bd89df9503713527641d
2023-12-11guix: Add target-avr?.Jean-Pierre De Jesus DIAZ
* guix/utils.scm (target-avr?): New procedure. * tests/utils.scm: Add tests for target-avr? procedure. Change-Id: Iaa0fa97a2b6bc45d45f907f43157f1548a0ba3fa Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2023-08-31gnu: services: Revert to deleting and updating all matching servicesBrian Cully
This patch reverts the behavior introduced in 181951207339508789b28ba7cb914f983319920f which caused ‘modify-services’ clauses to only match a single instance of a service. We will now match all service instances when doing a deletion or update, while still raising an exception when trying to match against a service that does not exist in the services list, or which was deleted explicitly by a ‘delete’ clause (or an update clause that returns ‘#f’ for the service). Fixes: #64106 * gnu/services.scm (%modify-services): New procedure. (modify-services): Use it. (apply-clauses): Add DELETED-SERVICES argument, change to modify one service at a time. * tests/services.scm ("modify-services: delete then modify") ("modify-services: modify then delete") ("modify-services: delete multiple services of the same type") ("modify-services: modify multiple services of the same type"): New tests. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-11-11guix: syscalls: Add terminal-string-width.Julien Lepiller
* guix/build/syscalls.scm (terminal-width): New procedure. * tests/syscalls.scm: Add tests. Change-Id: I6c2caa9fbaffb1e8f4b8933103399be970d5a8f3
2023-08-28import-utils: Do not include punctuation when wrapping in @code{}.Ricardo Wurmus
* guix/import/utils.scm (beautify-description): Exclude punctuation. * tests/import-utils.scm: Add new test.
2023-11-05tests: Make ‘guix time-machine’ test effective.Ludovic Courtès
The test as added in 79ec651a286c71a3d4c72be33a1f80e76a560031 had no effect: first because ‘guix time-machine --commit=X’, not followed by a command, does nothing, and second because the “! COMMAND” shell stanza does not have the desired effect (see <https://issues.guix.gnu.org/62406>). This change rewrites the test to make it effective. * tests/guix-time-machine.sh: Rewrite. Change-Id: Ib44a11331c8625e346139a236cffa699cdbd02f2
2023-08-26gnu-maintenance: Consider Qt source tarballs as "release files".Maxim Cournoyer
* guix/gnu-maintenance.scm (release-file?): Use positive logic in doc. Add a special case for Qt source archives. * tests/gnu-maintenance.scm ("release-file?"): Update test.
2023-08-26gnu-maintenance: Add support to rewrite version in URL path.Maxim Cournoyer
Fixes <https://issues.guix.gnu.org/64015>. Fixes <https://issues.guix.gnu.org/65304>. Previously, the generic HTML updater would only look for the list of files found at the parent of its current source URL, ignoring that the URL may embed the version elsewhere in its path. This could cause 'guix refresh' to report no updates available, while in fact there were, such as for 'libuv'. * guix/gnu-maintenance.scm (strip-trailing-slash): New procedure. (%version-rx): New variable. (rewrite-url): New procedure. (import-html-release): New rewrite-url? argument. When true, use the above procedure. (import-html-updatable-release): Call import-html-release with #:rewrite-url set to #t. * tests/gnu-maintenance.scm ("rewrite-url, to-version specified") ("rewrite-url, without to-version"): New tests.
2023-08-25tests: guix-home: Fix description search for home-mcron.Josselin Poiret
* tests/guix-home.sh: home-mcron has changed description, adapt the search.
2023-08-25tests: guix-shell: Use bash instead of user's $SHELL.Josselin Poiret
* tests/guix-shell.sh (fd_list): Use bash instead of $SHELL. Some other shells have trouble not opening too many fds. Also, bash in an implicit input of guix, so it should always be available.
2023-10-28tests: Adjust to cope with glibc graft.Ludovic Courtès
This is a followup to 1328c4cca531318e3ed90c6aecb522a5b22a4bcc, which led to failures for tests that were not prepared to cope with that. * tests/guix-environment-container.sh (hello_drv_nested): Pass “-E GUIX_BUILD_OPTIONS” so ‘--no-grafts’ is passed. * tests/guix-pack.sh (GUIX_BUILD_OPTIONS): Add ‘--no-grafts’. * tests/transformations.scm ("options->transformation, with-graft"): Skip when ‘glibc-final’ has a replacement. Change-Id: Ia65c9aeb06f524252815b8290a5ca7bf97ee8136
2023-10-28profiles: Hooks honor the #:system parameter of ‘profile-derivation’.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/65225>. * guix/profiles.scm (info-dir-file, package-cache-file) (info-dir-file, ghc-package-cache-file, ca-certificate-bundle) (emacs-subdirs, gdk-pixbuf-loaders-cache-file, glib-schemas) (gtk-icon-themes, gtk-im-modules, linux-module-database) (xdg-desktop-database, xdg-mime-database, fonts-dir-file) (manual-database, manual-database/optional): Add optional #:system parameter and pass it to ‘gexp->derivation’. (profile-derivation): Pass HOOK a second parameter, SYSTEM. * gnu/bootloader.scm (efi-bootloader-profile)[efi-bootloader-profile-hook]: Add optional #:system parameter and pass it to ‘gexp->derivation’. * guix/channels.scm (package-cache-file): Likewise. * tests/profiles.scm ("profile-derivation, #:system, and hooks"): New test. Reported-by: Tobias Geerinckx-Rice <me@tobias.gr>
2023-10-28grafts: Fix corner case involving multiple-output derivations.Ludovic Courtès
Fixes a bug that would occur with references to two outputs of the same derivation, with one of them referring to the other one. For example, the references of libreoffice include both mariadb:dev and mariadb:lib; additionally, mariadb:dev refers to mariadb:lib. In this case, the glibc graft would not be applied on one of the mariadb paths, and both the grafted and ungrafted glibc would end up in the closure of libreoffice. Fixes <https://issues.guix.gnu.org/66662>. * guix/grafts.scm (non-self-references): Simplify and include references to outputs of DRV other than OUTPUTS. (reference-origins): Simplify and possibly return outputs of DRV itself. (cumulative-grafts)[graft-origin?]: Add OUTPUT parameter and honor it. [dependency-grafts]: Adjust accordingly. * tests/grafts.scm ("graft-derivation, multiple outputs need to be replaced"): New test. Change-Id: Iac2005024ab7049037537b3af55298696ec90e3c
2023-08-21tests: Adjust 'node-back-edges' test for 'bag' to system-dependent glibc.Ludovic Courtès
Fixes a regression introduced in 560cb51e7b37e2c6f6fe4b72a3781185c57fdf83, which would lead this test on x86_64-linux to return a DIFF with two packages, nhc98 and dev86 (both have #:system "i686-linux" and thus depend on a different glibc object; why other system-specific packages such as 'wine' aren't reported is unclear). * tests/graph.scm ("node-transitive-edges + node-back-edges"): Use 'test-equal'. Define 'system-specific?' and use it.
2023-08-18tests: store-roots: Remove bogus test.Ludovic Courtès
This test was added in 1261ce15233cbf7e24de9959df86a23b46314a28 but it proved to be bogus: <https://issues.guix.gnu.org/64760>. * tests/store-roots.scm ("gc-roots, initial"): Remove.
2023-08-18tests: packages: Set system for expected result of package->bag.Josselin Poiret
* tests/packages.scm ("package->bag"): Parameterize the expected result by the system used to lower the package to a bag. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-08-17ui: 'load*' accepts /dev/fd/N files pointing to a pipe.Ludovic Courtès
This allows users to write Bash commands like: guix time-machine -C <(echo %default-channels) -- ... or: guix build -m <(echo '(specifications->manifest (list "guile"))') Previously, on GNU/Linux, they would fail with: error: failed to load '/dev/fd/63': No such file or directory * guix/ui.scm (try-canonicalize-path): New procedure. (load*): Use it. * tests/guix-build.sh: Test 'guix build -m' with a /dev/fd/N file.
2023-08-16scripts: time-machine: Error when attempting to visit too old commits.Maxim Cournoyer
* doc/guix.texi (Invoking guix time-machine): Document limitation. * guix/inferior.scm (cached-channel-instance): New VALIDATE-CHANNELS argument. Use it to validate channels when there are no cache hit. * guix/scripts/time-machine.scm (%options): Tag the given reference with 'tag-or-commit instead of 'commit. (%oldest-possible-commit): New variable. (guix-time-machine) <validate-guix-channel>: New nested procedure. Pass it to the 'cached-channel-instance' call. * tests/guix-time-machine.sh: New test. * Makefile.am (SH_TESTS): Register it. Suggested-by: Simon Tournier <zimon.toutoune@gmail.com> Reviewed-by: Ludovic Courtès <ludo@gnu.org> Reviewed-by: Simon Tournier <zimon.toutoune@gmail.com>
2023-08-13tests: Fix texlive->guix-package test.Tobias Geerinckx-Rice
This follows up on commit 985cf777b9aa394d4469205d6fea98d367a2ef32. * tests/texlive.scm ("texlive->guix-package"): Don't expect a texlive-texworks propagated input.
2023-08-13tests: Fix texlive->guix-package test.Tobias Geerinckx-Rice
This follows up on commit 1619f2c18c1b3cca41f52fea3d7231b9ad490af8. * tests/texlive.scm ("texlive->guix-package"): Don't expect a ‘license:’ prefix to ‘fsf-free’.
2023-08-15refresh: Add --target-version option.Maxim Cournoyer
* guix/scripts/refresh.scm (%options): Register 'target-version' long version. (update-specification->update-spec): Add a fallback-version argument. (options->update-specs): Honor target-version option. * tests/guix-refresh.sh: Test it. * doc/guix.texi (Invoking guix refresh): Document it. Reviewed-by: Ludovic Courtès <ludo@gnu.org>
2023-10-22guix: import: Don't import yanked rust crates.Efraim Flashner
* guix/import/crate.scm (<crate-version>): Add yanked? field. (crate->guix-package)[find-crate-version]: Remove versions which have been yanked. * tests/crate.scm: Adjust tests for new yanked? field.
2023-10-21tests: Verify plasma.tmpl at x86_64-linux.Zheng Junjie
Some architectures (like riscv64) do no support some of the KDE packages, so just test this example on x86_64-linux. * tests/guix-system.sh: Verify plasma.tmpl to test build it at x86_64-linux. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-10-20tests: Avoid three-argument ‘test-assertm’.Ludovic Courtès
This fixes a discrepancy with other tests that have a two-argument ‘test-assertm’ macro. * tests/pack.scm (test-assertm): Move within ‘with-external-store’, and remove ‘store’ parameter.
2023-08-10services: Add pam-mount-volume-service-type.Brian Cully
The `pam-mount-volumes-service-type' adds additional volumes to the pam-mount-service-type in addition to any that are already specified in `pam-mount-rules'. * doc/guix.texi (PAM Mount Volume Service): add documentation for `pam-mount-service-type'. * gnu/services/pam-mount.scm: new file. * Makefile.am: add pam-mount tests * tests/services/pam-mount.scm: new tests Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-10-07services: configuration: Use transducers within serialize-configuration.Bruno Victal
Introduces 'base-transducer', a SRFI-171 based transducer that can be used as a starting point for writing custom configuration record serializing procedures. This also fixes the symbol maybe-value serialization test case. * gnu/services/configuration.scm (empty-serializer?): New predicate. (base-transducer, tfilter-maybe-value): New procedure. (serialize-configuration): Adapt to use base-transducer. * gnu/services/telephony.scm (jami-account->alist): Use transducers to skip fields that are unserializable or whose field maybe-value is unset. * tests/services/configuration.scm: Remove test-expect-fail. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-07-21services: wireguard: Implement a dynamic IP monitoring feature.Maxim Cournoyer
* gnu/services/vpn.scm (<wireguard-configuration>) [monitor-ips?, monitor-ips-internal]: New fields. * gnu/services/vpn.scm (define-with-source): New syntax. (wireguard-service-name, strip-port/maybe) (ipv4-address?, ipv6-address?, host-name?) (endpoint-host-names): New procedure. (wireguard-monitoring-jobs): Likewise. (wireguard-service-type): Register it. * tests/services/vpn.scm: New file. * Makefile.am (SCM_TESTS): Register it. * doc/guix.texi (VPN Services): Update doc. Reviewed-by: Bruno Victal <mirai@makinata.eu>
2023-07-19import/utils: beautify-description: Wrap class names in @code{...}.Ricardo Wurmus
* guix/import/utils.scm (beautify-description): Add procedure to wrap words in @code{...} markup. * tests/import-utils.scm: Add two tests.
2023-07-18tests: pack: Fix indentation.Maxim Cournoyer
* tests/pack.scm: Fix indentation.
2023-07-18pack: Move common build code to (guix build pack).Maxim Cournoyer
The rationale is to reduce the number of derivations built per pack to ideally one, to minimize storage requirements. The number of derivations had gone up with 68380db4 ("pack: Extract populate-profile-root from self-contained-tarball/builder.") as a side effect to improving code reuse. * guix/scripts/pack.scm (guix): Add commentary comment. (populate-profile-root, self-contained-tarball/builder): Extract to... * guix/build/pack.scm (populate-profile-root): ... this, and... (build-self-contained-tarball): ... that, adjusting for use on the build side. (assert-utf8-locale): New procedure. (self-contained-tarball, debian-archive, rpm-archive): Adjust accordingly. Reviewed-by: Ludovic Courtès <ludo@gnu.org>
2023-07-18guix: Let texlive importer handle linked scripts.Nicolas Goaziou
* guix/import/texlive.scm (tlpdb): Also retrieve so-called binfiles. (formats): (linked-scripts): New functions. (tlpdb->package): Use new functions to set #:LINK-SCRIPTS argument and possibly INPUTS. * tests/texlive.scm (%fake-tlpdb): Add test data. ("texlive->guix-package, single script, no extension"): ("texlive->guix-package, multiple scripts, with extensions"): ("texlive->guix-package, script with associated input"): New tests.
2023-07-18guix: texlive importer: Set #:texlive-latex-bin? when appropriate.Nicolas Goaziou
* guix/import/texlive.scm (latex-bin-dependency-tree): New function. (tlpdb->package): Set #:TEXLIVE-LATEX-BIN? when appropriate. * tests/texlive.scm ("texlive->guix-package, lonely `hyphen-base' dependency and ARCH"): Update test.
2023-07-18guix: texlive importer: Fix build system and arguments for meta-packages.Nicolas Goaziou
* guix/import/texlive.scm (tlpdb->package): Meta packages should use trivial build system and an appropriate builder. * tests/texlive.scm ("texlive->guix-package, meta-package"): ("texlive->guix-package, translate dependencies"): Update tests.
2023-07-18guix: texlive importer ignores dependencies unnecessary in Guix.Nicolas Goaziou
* guix/import/texlive.scm (translate-depends): New function. (tlpdb->package): Use new function. * tests/texlive.scm (%fake-tlpdb): Add test data. ("texlive->guix-package, translate dependencies"): ("texlive->guix-package, lonely `hyphen-base' dependency and ARCH"): New tests.
2023-07-18guix: Let texlive importer suggest format creation.Nicolas Goaziou
* guix/import/texlive.scm (tlpdb): Store "execute" entries. (tlpdb->package): Add #:CREATE-FORMATS argument when there is an AddFormat execute action. * tests/texlive.scm (%fake-tlpdb): Add test data. ("texlive->guix-package, with TeX format"): ("texlive->guix-package, execute but no TeX format"): New tests.
2023-07-18guix: import: Improve importing texlive meta packages.Nicolas Goaziou
* guix/import/texlive.scm (tlpdb->package): Generate more appropriate source, home page and license fields when importing meta packages, i.e., TeX Live collections and schemes. * tests/texlive.scm (%fake-tlpdb): Add test data. ("texlive->guix-package, meta-package"): New test.
2023-07-18guix: import: Handle native inputs in texlive importer.Nicolas Goaziou
* guix/import/texlive.scm (tlpdb->package): Add TEXLIVE-METAFONT as a native input whenever font metrics are to be generated. * tests/texlive.scm (%fake-tlpdb): Add test data. ("texlive->guix-package, with METAFONT files"): New test.
2023-07-18guix: import: Fix multiple licenses output in texlive importer.Nicolas Goaziou
* guix/import/texlive.scm (string->license): Add missing case and try first to split license strings before giving up. * tests/texlive.scm (%fake-tlpdb): Add test data. ("texlive->guix-package, multiple licenses"): New test.
2023-07-18guix: import: Improve home-page generation in texlive importer.Nicolas Goaziou
* guix/import/texlive.scm (tlpdb): Also register `catalogue' key. (tlpdb->package): First try to use catalogue for the home-page, then the name. * tests/texlive.scm (%fake-tlpdb): Add tests data. ("texlive->guix-package, with catalogue entry, no inputs"): New test.
2023-07-18guix: import: Update texlive importer according to new build system.Nicolas Goaziou
* guix/import/texlive.scm (tlpdb->package): Generate a package that doesn't need SIMPLE-TEXLIVE-PACKAGE. * guix/import/utils.scm (package->definition): Remove special case for `simple-texlive-package'. * tests/texlive.scm (%fake-tlpdb): Add test data. ("texlive->guix-package"): Update test. ("texlive->guix-package, no docfiles"): New test.
2023-07-11home: services: bash: Properly quote shell aliases.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/63048>. Reported by Ekaitz Zarraga <ekaitz@elenq.tech>. * gnu/home/services.scm (with-shell-quotation-bindings): New procedure. (environment-variable-shell-definitions): Use it instead of inline copy. * gnu/home/services/shells.scm (bash-serialize-aliases): Use it. Add clause for 'literal-string?'. * tests/guix-home.sh: Add 'aliases' to 'home-bash-extension' and test it.
2023-06-18Add 'guix locate'.Ludovic Courtès
* guix/scripts/locate.scm, tests/guix-locate.sh: New files. * Makefile.am (MODULES): Add 'guix/scripts/locate.scm'. (SH_TESTS): Add 'tests/guix-locate.sh'. * po/guix/POTFILES.in: Add it. * doc/guix.texi (Invoking guix locate): New node. Co-authored-by: Antoine R. Dumont <antoine.romain.dumont@gmail.com>
2023-06-18store: Tolerate non-existent GC root directories.Ludovic Courtès
* guix/store/roots.scm (gc-roots): Wrap 'scandir*' call in 'catch'. * tests/store-roots.scm ("gc-roots, initial"): New test. Move 'open-connection' call below.
2023-06-14packages: 'package-transitive-supported-systems' detects cycles.Ludovic Courtès
With this change, commands such as 'guix build' or 'guix package' report obvious package-level cycles upfront. Derivation-level cycles are not detected. * guix/packages.scm (&package-cyclic-dependency-error): New condition type. (package-transitive-supported-systems): Define 'visited', check it, and parameterize it. * guix/ui.scm (call-with-error-handling): Handle '&package-cyclic-dependency-error'. * tests/packages.scm ("package-transitive-supported-systems detects cycles"): Add test.
2023-06-09tests: Ensure 'elpa' test does not access the network.Ludovic Courtès
Previously it would try to access the real elpa.gnu.org. This would succeed when network is available because "taxy-magit-section" is an existing package. * guix/import/elpa.scm (elpa-repository) (package-from-elpa-repository?): Recognize 'gnu/http. * tests/elpa.scm ("package-latest-release"): Use 'http' instead of 'https'. Change "taxy-magit-section" to "fake-taxy-magit-section".
2023-06-09tests: Ensure 'cpan' updater test does not access the network.Ludovic Courtès
Previously it would try to access the real metacpan.org. This would succeed when network is available because "Test-Script" is an existing package. * tests/cpan.scm ("package-latest-release"): Wrap 'upstream-source-inputs' call in 'parameterize'. Set 'current-http-proxy'. Change the order of responses in 'with-http-server'.
2023-06-09tests: Adjust minetest tests.Ludovic Courtès
Fixes a regression introduced in e7910f4882d520fcf8920df9ff4ddb00eb9ee41d. * tests/minetest.scm (call-with-packages): Add #:timeout parameter to 'http-fetch' mock.
2023-06-08substitute: Gracefully retry after failed partial downloads.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/63443>. Reported by Attila Lendvai <attila@lendvai.name>. * guix/scripts/substitute.scm (catch-system-error): New macro. (download-nar): Add call to 'delete-file-recursively'. * tests/substitute.scm ("substitute, previous partial download around"): New test.