summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Expand)Author
2022-06-15services: configuration: Use *unspecified* instead of 'disabled....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> Attila Lendvai
2022-06-15services: configuration: Support (field1 maybe-number "") format....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> Attila Lendvai
2022-06-15system: <operating-system> compiler truly honors the 'system' argument....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. Ludovic Courtès
2022-06-06packages: Add 'specifications->packages'....* 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> Antero Mejr
2022-06-06import: hackage: Filter upper/mixed case dependencies too....* 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. Lars-Dominik Braun
2022-06-06import: hackage: Filter internal libraries from inputs and native-inputs....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. Lars-Dominik Braun
2022-06-06import: cabal: Support library names...* 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. Lars-Dominik Braun
2022-06-06import: cabal: Document failing syntax through tests....* 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. Lars-Dominik Braun
2022-06-06import: cabal: Allow curly bracket before else statement....* 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. Lars-Dominik Braun
2022-06-06import: cabal: Allow properties without space between key and value....* 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. Lars-Dominik Braun
2022-06-06import: cabal: Allow curly brackets in more positions....* 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. Lars-Dominik Braun
2022-06-06import: cabal: Support elif statement....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. Lars-Dominik Braun
2022-06-04home: services: Add 'lookup-home-service-types' procedure....* gnu/home/services.scm (lookup-home-service-types): New procedure. * tests/home-services.scm: New file. * Makefile.am (SCM_TESTS): Add it. Ludovic Courtès
2022-06-04cache: Catch invalid 'last-expiry-cleanup'....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> zimoun
2022-06-01shell: '--export-manifest -D x -D y' generates a valid manifest....* guix/scripts/shell.scm (manifest->code*): Add missing 'list' in generated 'concatenate-manifests' call. * tests/guix-shell-export-manifest.sh: Add test. Ludovic Courtès
2022-05-31gnu: Remove python2-matplotlib....* gnu/packages/python-xyz.scm (python2-matplotlib): Delete variable. * tests/profiles.scm ("package->manifest-entry, search paths"): Use python 3 matplotlib in test. Maxim Cournoyer
2022-05-30tests: Adjust crate importer test to spdx changes....This is a followup to 95b0544fcfa1a663435a9ac84db94312b938022b. * tests/crate.scm ("licenses: MIT/Apache-2.0 AND BSD-2-Clause"): Adjust expected result. Ludovic Courtès
2022-05-25tests: Fix wrong target triplets....* 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> Josselin Poiret
2022-05-23scripts: package: Transform before creating manifest entries....* 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> Josselin Poiret
2022-05-22import: Add Elm importer....* 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> Philip McGrath
2022-05-22guix: Add elm-build-system....* 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> Philip McGrath
2022-05-20inferior: Close duplicate socketpair file descriptor....* guix/inferior.scm (open-bidirectional-pipe): Pass SOCK_CLOEXEC to 'socketpair'. * tests/inferior.scm ("close-inferior"): Add test. Ludovic Courtès
2022-05-18tests: Ensure test OpenPGP keys never expire....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. Ludovic Courtès
2022-05-18services: Make <service-type> 'description' field mandatory....* gnu/services.scm (<service-type>)[description]: Remove default value. * tests/services.scm: Add 'description' field to each 'service-type' form. Ludovic Courtès
2022-05-05transformations: Preserve transformation order in package property....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. Ludovic Courtès
2022-05-01gexp: Add 'references-file'....* gnu/services/base.scm (references-file): Remove. * guix/gexp.scm (references-file): New procedure. * tests/gexp.scm ("references-file"): New test. Ludovic Courtès
2022-04-29publish: Send uncached narinfo replies from the main thread....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. Ludovic Courtès
2022-04-19tests: Adjust 'guix home' test to 'home-files-service-type' changes....This is a followup to 5832d9fb601c7d4ec5380654db2b62b906bc658f. * tests/guix-home.sh: Change "config" to ".config" in 'home-files-service-type' extension. Ludovic Courtès
2022-04-14style: Correctly read dots in pairs and improper lists....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. Ludovic Courtès
2022-04-10services: Test 'shepherd-service-upgrade' with transient services....This is a followup to eeb8ac43c8c0b0cc69422766070dbefc55f5c5c1. * tests/services.scm ("shepherd-service-upgrade: transient service"): New test. Ludovic Courtès
2022-04-10services: herd: Adjust to <live-service> changes....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'. Ludovic Courtès
2022-04-08tests: 'guix shell --export-manifest' test no longer needs networking....* tests/guix-shell-export-manifest.sh: Use '--with-input' rather than '--with-latest' as the latter would crash in the absence of network access. Ludovic Courtès
2022-04-04shell: Add '--export-manifest'....* 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. Ludovic Courtès
2022-04-04packages: Add 'package-unique-version-prefix'....* 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. Ludovic Courtès
2022-03-29download: Use https for main KDE source....* guix/download.scm (%mirrors)[kde]: Use https URIs for main KDE mirrors. * tests/lint.scm ("mirror-url: kde suggestion"): New test. Efraim Flashner
2022-03-20home: import: Properly parse aliases that contain quotes....* 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. Ludovic Courtès
2022-03-19guix home: Add 'container' command....* guix/scripts/home.scm (show-help, %options): Add '--network', '--share', and '--expose'. (not-config?, user-shell, spawn-home-container): New procedures. (%default-system-profile): New variable. (perform-action): Add #:file-system-mappings, #:container-command, and #:network?; honor them. (process-action): Adjust accordingly. (guix-home)[parse-sub-command]: Add "container". [parse-args]: New procedure. Use it instead of 'parse-command-line'. * tests/guix-home.sh: Add tests. * doc/guix.texi (Declaring the Home Environment): Mention 'guix home container' as a way to test configuration. (Invoking guix home): Document it. Ludovic Courtès
2022-03-18guix home: Implement the 'extension-graph' and 'shepherd-graph' actions....Until now these two actions were silently ignored. * guix/scripts/home.scm (show-help, %options): Add "--graph-backend". (%default-options): Add 'graph-backend' key. (export-extension-graph, export-shepherd-graph): New procedures. (perform-action): Add #:graph-backend parameter. Add cases for the 'extension-graph' and 'shepherd-graph' actions. (process-action): Pass #:graph-backend to 'perform-action'. * guix/scripts/system.scm (service-node-type) (shepherd-service-node-type): Export * tests/guix-home.sh: Add tests. * doc/guix.texi (Invoking guix home): Document it. Ludovic Courtès
2022-03-16system: Improve 'read-boot-parameters' incompatibility diagnostic....Previously, when reading an incompatible "parameters" file, 'guix system' would print a warning and then crash with a wrong-type-arg backtrace because code expects 'read-boot-parameters' to always return a <boot-parameters> record. * gnu/system.scm (read-boot-parameters): Upon incompatibility, raise an error instead of returning #f. Also raise a '&fix-hint' condition. * tests/boot-parameters.scm ("read, construction, mandatory fields"): Define 'test-read-boot-parameters' as a macro; expect 'formatted-message?' exceptions rather than #f returns. Ludovic Courtès
2022-03-16packages: 'modify-inputs' preserves outputs in 'replace' clauses....Fixes <https://issues.guix.gnu.org/53915>. Reported by Gordon Quad <gordon@niflheim.info>. * guix/packages.scm (replace-input): Preserve the outputs of INPUT by default. * tests/packages.scm ("modify-inputs, replace, extra output"): New test. Ludovic Courtès
2022-03-16tests: Exercise 'modify-inputs' with a 'replace' clause....* tests/packages.scm ("modify-inputs, replace") ("modify-inputs, replace, change output"): New tests. Ludovic Courtès
2022-03-13gexp: Correctly handle #$output in 'gexp->approximate-sexp'....This addresses the following backtrace from "guix lint -c wrapper-inputs hostapd": Backtrace:ostapd@2.10 [wrapper-inputs]... [...] 174:9 3 (gexp->approximate-sexp #<gexp (modify-phases %standard?>) In srfi/srfi-1.scm: 586:17 2 (map1 (#<gexp-output out> #<gexp-input "pkg-config":o?>)) In guix/gexp.scm: 175:16 1 (_ _) In ice-9/boot-9.scm: 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: Throw to key `match-error' with args `("match" "no matching pattern" #<gexp-output out>)'. * guix/gexp.scm (gexp->approximate-sexp): Handle the case where 'reference' is a <gexp-output>,, by returning (*approximate*). * tests/gexp.scm ("gexp->approximate-sexp, outputs"): Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Maxime Devos
2022-03-13gexp: Correctly handle unquoting S-exp objects....This fixes a false-positive in the linter: guix lint -c 'wrapper-inputs' libaio * guix/gexp.scm (gexp->approximate-sexp): Allow the 'thing' in <gexp-input> to be a sexp, without approximation, by testing if it is a record. * tests/gexp.scm ("unquoted sexp (not a gexp!)"): Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Maxime Devos
2022-03-11lint: check-tests-true: Allow #:tests? #t for some build systems....emacs-build-system sets #:tests? #f by default, so the linter shouldn't warn if #:tests? #t is set for packages using emacs-build-system. Likewise for texlive-build-system. * guix/lint.scm (check-tests-true): Do not warn if the build system is emacs-build-system or texlive-build-system. * tests/lint.scm ("tests-true: #:tests? #t acceptable for emacs packages") ("tests-true: #:tests? #t acceptable for texlive packages"): New tests. Fixes: <https://issues.guix.gnu.org/50299> Reported-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Maxime Devos
2022-03-10tests: Check 'guix home reconfigure' for a second generation....* tests/guix-home.sh: Invoke "guix home reconfigure" a second time with a modify config file and check the result. Ludovic Courtès
2022-03-10tests: Simplify use of 'local-file' in 'tests/guix-home.sh'....* tests/guix-home.sh: Remove 'current-filename' trickery since 'local-file' resolves file names relative to the containing file. Ludovic Courtès
2022-03-10tests: Make sure 'guix home reconfigure' backs up files....* tests/guix-home.sh: Create ~/.bashrc and ~/.config/test.conf prior to 'reconfigure' and check whether they were backed up. Ludovic Courtès
2022-03-07derivations: Coalesce inputs that have the same output path....Fixes <https://issues.guix.gnu.org/54209>. * guix/derivations.scm (coalesce-duplicate-inputs): Use the output paths of DRV as a hash table key. * tests/derivations.scm ("derivation with duplicate fixed-output inputs"): Expect a single input for FINAL. ("derivation with equivalent fixed-output inputs"): New test. Ludovic Courtès
2022-03-07tests: Adjust to (guix import github) changes....This is a followup to a8d3033da61958c53c44dd5db90672bfc4533ef9. * tests/import-github.scm (call-with-releases): Mock 'open-connection-for-uri'. Ludovic Courtès
2022-03-06tests: Add (guix http-client) tests....* tests/http-client.scm: New file. * Makefile.am (SCM_TESTS): Add it. * .dir-locals.el (scheme-mode): Add 'with-http-server'. Ludovic Courtès