summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAge
* style: For 'let' and similar forms, emit one binding per line.Ludovic Courtès2022-07-04
| | | | | | | | | | | | | | | | | | Previously, 'let' bindings could be rendered like this: (let ((x 1) (y 2) (z 3)) ...) With this change, each bindings goes in its own line. Partly fixes <https://issues.guix.gnu.org/56297>. Reported by Maxime Devos <maximedevos@telenet.be>. * guix/scripts/style.scm (pretty-print-with-comments)[list-of-lists?]: New procedure. Use it. * tests/style.scm: Add tests with 'let' and 'substitute-keyword-arguments'.
* tests: Adjust 'guix graph' test to latest OCaml changes.Ludovic Courtès2022-07-01
| | | | | * tests/graph.scm ("reverse bag DAG"): Adjust to latest OCaml changes by looking at dune/ocaml-camomile/ocaml-utop.
* profiles: Do not repeat entries in 'manifest' file.Ludovic Courtès2022-07-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/55499>. Reported by Ricardo Wurmus <rekado@elephly.net>. With this change, the manifest file created for: guix install r r-seurat r-cistopic r-monocle3 r-cicero-monocle3 r-assertthat goes from 5.7M to 176K. Likewise, on this profile, wall-clock time of: GUIX_PROFILING=gc guix package -I goes from 0.7s to 0.1s, with heap usage going from 55M to 9M. * guix/profiles.scm (manifest->gexp)[optional]: New procedure. [entry->gexp]: Turn into a monadic procedure. Return a 'repeated' sexp if ENTRY was already visited before. Adjust caller accordingly. Bump manifest version. (sexp->manifest)[sexp->manifest-entry]: Turn into a monadic procedure. Add case for 'repeated' nodes. Add each entry to the current state vhash. Add clause for version 4 manifests. [sexp->manifest-entry/v3]: New procedure, with former 'sexp->manifest-entry' code. * tests/profiles.scm ("deduplication of repeated entries"): New test. * guix/build/profiles.scm (manifest-sexp->inputs+search-paths)[let-fields]: New macro. Use it. Expect version 4. Add clause for 'repeated' nodes.
* tests: Augment profile collision test.Ludovic Courtès2022-07-01
| | | | | * tests/profiles.scm ("collision of propagated inputs"): Check the parents of ENTRY1 and ENTRY2.
* tests: Add sanitizer test.Ludovic Courtès2022-07-01
| | | | | * tests/records.scm ("define-record-type* & sanitize without default value"): New test.
* status: Relay "updating substitutes" messages.Ludovic Courtès2022-06-26
| | | | | | | | | | | | | Until now, those messages would be accumulated and displayed all at once, when a '\n' was finally emitted by 'guix substitute'. In the meantime, clients would remain silent. * guix/status.scm (bytevector-index): Change 'number' parameter to 'numbers' and adjust accordingly. (build-event-output-port): Pass both #\newline and #\return to 'bytevector-index'. * tests/status.scm ("build-output-port, daemon messages with LF"): New test.
* status: Change tests from SRFI-11 to SRFI-71.Ludovic Courtès2022-06-26
| | | | * tests/status.scm: Use SRFI-71 'let' instead of SRFI-11 'let-values'.
* services: configuration: Report the location of field type errors.Ludovic Courtès2022-06-24
| | | | | | | | | | | | | | | | | Previously field type errors would be reported in a non-standard way, and without any source location information. This fixes it. * gnu/services/configuration.scm (configuration-field-error): Add a 'loc' parameter and honor it. Use 'formatted-message' instead of plain 'format'. (define-configuration-helper)[field-sanitizer]: New procedure. Use it. Use STEM as the identifier of the syntactic constructor of the record type. Add a 'sanitize' property to each field. Remove now useless STEM macro that would call 'validate-configuration'. * gnu/services/mail.scm (serialize-listener-configuration): Adjust to new 'configuration-field-error' prototype. * tests/services/configuration.scm ("wrong type for a field"): New test. * po/guix/POTFILES.in: Add gnu/services/configuration.scm.
* style: Keep values next to their keyword.Ludovic Courtès2022-06-22
| | | | | | | | | This ensures we print '#:key value' rather than insert a newline between '#:key' and 'value' as was the case before. * guix/scripts/style.scm (pretty-print-with-comments)[print-sequence]: When ITEM is a keyword, loop with FIRST? = true. * tests/style.scm: Add test.
* guix: emacs-utils: Add emacs-header-parse.Fredrik Salomonsson2022-06-17
| | | | | | | | | | * guix/build/emacs-utils.scm (emacs-header-parse): New procedure. * tests/build-emacs-utils.scm ("emacs-header-parse: fetch version", "emacs-header-parse: fetch keywords", "emacs-header-parse: fetch nonexistent author"): New tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix: emacs-utils: Add emacs-batch-script.Fredrik Salomonsson2022-06-17
| | | | | | | | | | * guix/build/emacs-utils.scm (emacs-batch-script): New procedure. * tests/build-emacs-utils.scm: New file. * Makefile.am (TESTS): Add `tests/build-emacs-utils.scm'. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* ui: Improve pager selection logic when less is not installed.Taiju HIGASHI2022-06-16
| | | | | | | | | | | | | | | | * guix/ui.scm (find-available-pager): New procedure. (call-with-paginated-output-port): Use it. * guix/utils.scm (call-with-environment-variables): Allow clearing of specified environment variables. * tests/ui.scm (make-empty-file, assert-equals-find-available-pager): New procedures. ("find-available-pager, GUIX_PAGER takes precedence") ("find-available-pager, PAGER takes precedence") ("find-available-pager, 'less' takes precedence") ("find-available-pager, 'more' takes precedence") ("find-available-pager, no pager"): New tests. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* shell: Fix '--export-manifest' for cached profiles and when '-p' is used.Ludovic Courtès2022-06-16
| | | | | | | | Fixes <https://issues.guix.gnu.org/55521>. * guix/scripts/shell.scm (export-manifest): When computing 'manifest', honor the 'profile key. * tests/guix-shell-export-manifest.sh: Add test.
* import: Add hex.pm importer.Hartmut Goebel2022-06-15
| | | | | | | | | | | | | hex.pm is a package repository for Erlang and Elixir. * guix/scripts/import.scm (importers): Add "hexpm". * guix/scripts/import/hexpm.scm, guix/import/hexpm.scm, guix/hexpm-download.scm: New files. * guix/import/utils.scm (source-spec->object): Add "hexpm-fetch" to list of fetch methods. * guix/upstream.scm (package-update/hexpm-fetch): New function. (%method-updates) Add it. * Makefile.am: Add them.
* services: configuration: Use *unspecified* instead of 'disabled.Attila Lendvai2022-06-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use *unspecified* as a marker for field values that have not been set. Rationale: 'disabled may easily clash with user values for boolean fields, is confusing (i.e. its meaning is *not* boolean false, but unspecified) and it also passes silently through the symbol? predicate of a field of type symbol. * gnu/services/configuration.scm (configuration-missing-default-value): Renamed from configuration-no-default-value. (define-maybe-helper): Use *unspecified* instead of 'disabled, and make the default value optional. * gnu/home/services/desktop.scm (home-redshift-configuration): Change (maybe-xyz 'disabled) to maybe-xyz. * gnu/services/authentication.scm (nslcd-configuration): Likewise. * gnu/services/cgit.scm (repository-cgit-configuration): Likewise. * gnu/services/file-sharing.scm (serialize-maybe-string) (serialize-maybe-file-object): Use 'unspecified?' instead of (eq? val 'disabled). * gnu/services/messaging.scm (raw-content?): Likewise. (ssl-configuration): Change (maybe-xyz 'disabled) to maybe-xyz. (prosody-configuration): Likewise. * gnu/services/file-sharing.scm (transmission-daemon-configuration): Likewise. * gnu/services/messaging.scm (define-all-configurations): Use *unspecified* instead of 'disabled'. * gnu/services/networking.scm (opendht-configuration): Likewise. * gnu/services/pm.scm (tlp-configuration): Likewise. * gnu/services/telephony.scm (jami-account): Likewise. (jami-configuration): Likewise. * gnu/services/vpn.scm (openvpn-client-configuration): Likewise. * tests/services/configuration.scm ("maybe type, no default") ("maybe type, with default"): New tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* services: configuration: Support (field1 maybe-number "") format.Attila Lendvai2022-06-15
| | | | | | | | | | | | | | | | | | As opposed to explicitly using 'disabled as value, or using the (field1 (maybe-number) "") format. It's mostly the work of Maxime Devos shared under #54674, with some modifications by Attila Lendvai. * gnu/services/configuration.scm (normalize-field-type+def): New function. (define-configuration-helper) (define-configuration): Support new field format. * tests/services/configuration.scm (config-with-maybe-number->string): New function. ("maybe value serialization of the instance"): New test. ("maybe value serialization of the instance, unspecified"): New test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* system: <operating-system> compiler truly honors the 'system' argument.Ludovic Courtès2022-06-15
| | | | | | | | | | Fixes <https://issues.guix.gnu.org/55951>. * gnu/system.scm (operating-system-compiler): Parameterize '%current-system' and '%current-target-system' before calling 'operating-system-derivation'. * tests/system.scm ("lower-object, %current-system sensitivity"): New test.
* packages: Add 'specifications->packages'.Antero Mejr2022-06-06
| | | | | | | | | | | | * gnu/packages.scm (specifications->packages): New procedure. * guix/scripts/home/import.scm (manifest+configuration-files->code): Use it. * tests/home-import.scm (match-home-environment-no-services) (match-home-environment-no-services-nor-packages) (match-home-environment-bash-service) (match-home-environment-bash-service-with-alias): Adjust 'packages' field accordingly. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* import: hackage: Filter upper/mixed case dependencies too.Lars-Dominik Braun2022-06-06
| | | | | | | | | * guix/import/hackage.scm (filter-dependencies): Convert OWN-NAMES to lowercase before filtering. (hackage-module->sexp): Remove #f from OWN-NAMES, which is used for unnamed (default) libraries. * tests/hackage.scm (test-cabal-internal-library-ignored): Add mismatched uppercase letters.
* import: hackage: Filter internal libraries from inputs and native-inputs.Lars-Dominik Braun2022-06-06
| | | | | | | | | | | Fixes <https://issues.guix.gnu.org/54760>. * guix/import/hackage.scm (filter-dependencies): Support multiple OWN-NAMES. (hackage-module->sexp): Filter OWN-NAMES from HACKAGE-DEPENDENCIES and HACKAGE-NATIVE-DEPENDENCIES. * tests/hackage.scm (test-cabal-internal-library-ignored): New variable. ("hackage->guix-package test internal libraries are ignored"): New testcase.
* import: cabal: Support library namesLars-Dominik Braun2022-06-06
| | | | | | | | | | | | | | * guix/import/cabal.scm (make-cabal-parser): Add name to section. (is-lib): Add optional name to regular expression. (lex-rx-res): Support selecting different substring. (lex-lib): Match 2nd substring from IS-LIB. (lex-line): Adapt to changes for lex-lib. (cabal-library): Add name field and export CABAL-LIBRARY-NAME. (eval): Remove special case for 'library, which is not required any more. (make-cabal-section): Move special case for LIBRARY. * tests/hackage.scm (test-read-cabal-library-name): New variable. ("read-cabal test 1"): Adapt testcase to changed internal structure. ("read-cabal test: library name"): New testcase.
* import: cabal: Document failing syntax through tests.Lars-Dominik Braun2022-06-06
| | | | | | | * tests/hackage.scm (test-read-cabal-brackets-newline): New variable. (test-cabal-no-final-newline): Likewise. ("hackage->guix-package test without final newline", "read-cabal test: property brackets on new line"): New tests.
* import: cabal: Allow curly bracket before else statement.Lars-Dominik Braun2022-06-06
| | | | | | | * guix/import/cabal.scm (is-else): Turn into procedure. (lex-line): Move IS-ELSE… (lex-word): …here. * tests/hackage.scm (test-cabal-elif-brackets): Extend testcase.
* import: cabal: Allow properties without space between key and value.Lars-Dominik Braun2022-06-06
| | | | | | * guix/import/cabal.scm (lex-word): Add colon to delimiters. * tests/hackage.scm (test-cabal-property-no-space): New variable. ("hackage->guix-package test properties without space"): New test.
* import: cabal: Allow curly brackets in more positions.Lars-Dominik Braun2022-06-06
| | | | | | | | * guix/import/cabal.scm (is-layout-property): Do not expect end of line. (lex-layout-property): Check for newline. (lex-property): Stop reading on closing curly bracket. * tests/hackage.scm (test-read-cabal-2): New variable. ("read-cabal test: if brackets on the same line"): New test.
* import: cabal: Support elif statement.Lars-Dominik Braun2022-06-06
| | | | | | | | | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/54752>. * guix/import/cabal.scm (make-cabal-parser): Replace if-then-else grammar case with elif-else, modify if-then accordingly. (is-elif): New procedure. (lex-elif): Likewise. (is-id): Add elif keyword. (lex-word): Add test for elif. * tests/hackage.scm (test-cabal-if): New variale. (test-cabal-else): Likewise. (test-cabal-elif): Likewise. (test-cabal-elif-brackets): Likewise. (match-ghc-elif): Likewise. ("hackage->guix-package test lonely if statement", "hackage->guix-package test else statement", "hackage->guix-package test elif statement", "hackage->guix-package test elif statement with brackets"): New tests.
* home: services: Add 'lookup-home-service-types' procedure.Ludovic Courtès2022-06-04
| | | | | | * gnu/home/services.scm (lookup-home-service-types): New procedure. * tests/home-services.scm: New file. * Makefile.am (SCM_TESTS): Add it.
* cache: Catch invalid 'last-expiry-cleanup'.zimoun2022-06-04
| | | | | | | | | | | | Fixes <http://issues.guix.gnu.org/55638>. * guix/cache.scm (maybe-remove-expired-cache-entries)[last-expiry-date]: Use 'get-string-all' + 'string->number' instead of 'read'; ignore invalid numbers. * tests/cache.scm ("maybe-remove-expired-cache-entries, empty cache") ("maybe-remove-expired-cache-entries, corrupted cache"): New tests. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* shell: '--export-manifest -D x -D y' generates a valid manifest.Ludovic Courtès2022-06-01
| | | | | | * guix/scripts/shell.scm (manifest->code*): Add missing 'list' in generated 'concatenate-manifests' call. * tests/guix-shell-export-manifest.sh: Add test.
* gnu: Remove python2-matplotlib.Maxim Cournoyer2022-05-31
| | | | | | * gnu/packages/python-xyz.scm (python2-matplotlib): Delete variable. * tests/profiles.scm ("package->manifest-entry, search paths"): Use python 3 matplotlib in test.
* tests: Adjust crate importer test to spdx changes.Ludovic Courtès2022-05-30
| | | | | | | This is a followup to 95b0544fcfa1a663435a9ac84db94312b938022b. * tests/crate.scm ("licenses: MIT/Apache-2.0 AND BSD-2-Clause"): Adjust expected result.
* tests: Fix wrong target triplets.Josselin Poiret2022-05-25
| | | | | | | | | | | | | | | | * tests/gexp.scm (ungexp + ungexp-native, input list + ungexp-native, input list splicing + ungexp-native-splicing, gexp list splicinng + ungexp-splicing, gexp->derivation, cross-compilation, gexp->derivation, ungexp-native, gexp->derivation, ungexp + ungexp-native, gexp->derivation, ungexp-native + composed gexps): Change mips64el-linux to mips64el-linux-gnu. * tests/guix-pack.sh: Change arm-unknown-linux-gnueabihf to arm-linux-gnueabihf. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* scripts: package: Transform before creating manifest entries.Josselin Poiret2022-05-23
| | | | | | | | | | | * guix/scripts/package.scm (options->installable): Add TRANSFORM argument, to be able to directly transform the new packages before creating their manifest entries. (process-actions): Remove transform-entry, and step3, transforming directly in step2. * tests/guix-package.sh: Add test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* import: Add Elm importer.Philip McGrath2022-05-22
| | | | | | | | | | | * guix/import/elm.scm, guix/scripts/import/elm.scm: New files. * Makefile.am (MODULES): Add them. * guix/scripts/import.scm (importers): Add "elm". * doc/guix.texi (Invoking guix import): Document Elm importer. * doc/contributing.texi (Elm Packages): Mention it. * tests/elm.scm ("(guix import elm)"): New test group. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix: Add elm-build-system.Philip McGrath2022-05-22
| | | | | | | | | | | | | | * gnu/packages/patches/elm-offline-package-registry.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/elm.scm (elm): Use it. * guix/build-system/elm.scm, guix/build/elm-build-system.scm, tests/elm.scm: New files. * Makefile.scm (MODULES, SCM_TESTS): Add them. * doc/guix.texi (Build Systems): Document 'elm-build-system'. * doc/contributing.texi (Elm Packages): New section. Document naming conventions and utilities. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* inferior: Close duplicate socketpair file descriptor.Ludovic Courtès2022-05-20
| | | | | | * guix/inferior.scm (open-bidirectional-pipe): Pass SOCK_CLOEXEC to 'socketpair'. * tests/inferior.scm ("close-inferior"): Add test.
* tests: Ensure test OpenPGP keys never expire.Ludovic Courtès2022-05-18
| | | | | | | | | | All these keys had expiration dates. 'tests/keys/ed25519.pub' expired on 2022-04-24. Fixes <https://issues.guix.gnu.org/55506>. * tests/keys/ed25519.pub, tests/keys/ed25519-2.pub, tests/keys/ed25519-3.pub: Remove expiration date.
* services: Make <service-type> 'description' field mandatory.Ludovic Courtès2022-05-18
| | | | | * gnu/services.scm (<service-type>)[description]: Remove default value. * tests/services.scm: Add 'description' field to each 'service-type' form.
* transformations: Preserve transformation order in package property.Ludovic Courtès2022-05-05
| | | | | | | | | | Fixes <https://issues.guix.gnu.org/54942>. Reported by SeerLite <seerlite@nixnet.email>. * guix/transformations.scm (options->transformation) [package-with-transformation-properties]: Add call to 'reverse'. * tests/transformations.scm ("options->transformation, property order"): New test.
* gexp: Add 'references-file'.Ludovic Courtès2022-05-01
| | | | | | * gnu/services/base.scm (references-file): Remove. * guix/gexp.scm (references-file): New procedure. * tests/gexp.scm ("references-file"): New test.
* publish: Send uncached narinfo replies from the main thread.Ludovic Courtès2022-04-29
| | | | | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/54723>. Reported by Guillaume Le Vaillant <glv@posteo.net>. Regression introduced in f743f2046be2c5a338ab871ae8666d8f6de7440b. With commit f743f2046be2c5a338ab871ae8666d8f6de7440b, responses to pipelined GETs would end up being written concurrently by many threads. Thus the body of those responses could be interleaved and garbled. * guix/scripts/publish.scm: Revert f743f2046be2c5a338ab871ae8666d8f6de7440b. * tests/publish.scm ("/*.narinfo pipeline"): New test.
* tests: Adjust 'guix home' test to 'home-files-service-type' changes.Ludovic Courtès2022-04-19
| | | | | | | This is a followup to 5832d9fb601c7d4ec5380654db2b62b906bc658f. * tests/guix-home.sh: Change "config" to ".config" in 'home-files-service-type' extension.
* style: Correctly read dots in pairs and improper lists.Ludovic Courtès2022-04-14
| | | | | | | | | | Until now dots were read as symbols. * guix/scripts/style.scm (read-with-comments)[dot]: New variable. [dot?, reverse/dot]: New procedures. Use 'reverse/dot' instead of 'reverse' when reading lists. * tests/style.scm ("read-with-comments: dot notation") ("((a . 1) (b . 2))", "(a b c . boom)"): New tests.
* services: Test 'shepherd-service-upgrade' with transient services.Ludovic Courtès2022-04-10
| | | | | | | This is a followup to eeb8ac43c8c0b0cc69422766070dbefc55f5c5c1. * tests/services.scm ("shepherd-service-upgrade: transient service"): New test.
* services: herd: Adjust to <live-service> changes.Ludovic Courtès2022-04-10
| | | | | | | | | | | This is a followup to a2c759c8304c461d096ab763568e7f71546ff4e8. * guix/scripts/system/reconfigure.scm (running-services): Fill in the 'transient?' field of <live-service>. * tests/services.scm ("shepherd-service-upgrade: one unchanged, one upgraded, one new") ("shepherd-service-upgrade: service depended on is not unloaded") ("shepherd-service-upgrade: obsolete services that depend on each other"): Adjust calls to 'live-service'.
* tests: 'guix shell --export-manifest' test no longer needs networking.Ludovic Courtès2022-04-08
| | | | | | * tests/guix-shell-export-manifest.sh: Use '--with-input' rather than '--with-latest' as the latter would crash in the absence of network access.
* shell: Add '--export-manifest'.Ludovic Courtès2022-04-04
| | | | | | | | | | | | * guix/scripts/shell.scm (show-help, %options): Add '--export-manifest'. (manifest-entry-version-prefix, manifest->code*) (export-manifest): New procedures. (guix-shell): Honor '--export-manifest'. * tests/guix-shell-export-manifest.sh: New file. * Makefile.am (SH_TESTS): Add it. * doc/guix.texi (Invoking guix shell): Document '--export-manifest'. (Invoking guix environment): Link to it. (Invoking guix pack): Likewise.
* packages: Add 'package-unique-version-prefix'.Ludovic Courtès2022-04-04
| | | | | | | * gnu/packages.scm (package-unique-version-prefix): New procedure. * guix/scripts/package.scm (manifest-entry-version-prefix): Use it. * tests/packages.scm ("package-unique-version-prefix, gcc@8") ("package-unique-version-prefix, grep"): New tests.
* download: Use https for main KDE source.Efraim Flashner2022-03-29
| | | | | * guix/download.scm (%mirrors)[kde]: Use https URIs for main KDE mirrors. * tests/lint.scm ("mirror-url: kde suggestion"): New test.
* home: import: Properly parse aliases that contain quotes.Ludovic Courtès2022-03-20
| | | | | | | | | * guix/scripts/home/import.scm (generate-bash-configuration+modules): Define 'alias-rx'. [bash-alias->pair]: Use it. * tests/home-import.scm (match-home-environment-bash-service-with-alias): New variable. ("manifest->code: Bash service with aliases"): New test.