summaryrefslogtreecommitdiff
path: root/tests/gexp.scm
Commit message (Collapse)AuthorAge
* gexp: Add 'let-system'.Ludovic Courtès2020-05-16
| | | | | | | | | | | | | | | * guix/gexp.scm (<system-binding>): New record type. (let-system): New macro. (system-binding-compiler): New procedure. (default-expander): Add 'self-quoting?' case. (self-quoting?): New procedure. (lower-inputs): Add 'filterm'. Pass the result of 'mapm/accumulate-builds' through FILTERM. (gexp->sexp)[self-quoting?]: Remove. * tests/gexp.scm ("let-system", "let-system, target") ("let-system, ungexp-native, target") ("let-system, nested"): New tests. * doc/guix.texi (G-Expressions): Document it.
* gexp: Add 'with-parameters'.Ludovic Courtès2020-03-12
| | | | | | | | | | * guix/gexp.scm (<parameterized>): New record type. (with-parameters): New macro. (compile-parameterized): New gexp compiler. * tests/gexp.scm ("with-parameters for %current-system") ("with-parameters for %current-target-system") ("with-parameters + file-append"): New tests. * doc/guix.texi (G-Expressions): Document it.
* gexp: Default to current target.base-for-series-3111Mathieu Othacehe2020-03-08
| | | | | | | | | | | * guix/gexp.scm (lower-object): Set target argument to 'current by default and look for the current target system at bind time if needed, (gexp->file): ditto, (gexp->script): ditto, (lower-gexp): make sure lowered extensions are not cross-compiled. * tests/gexp.scm: Add cross-compilation test-cases for gexp->script and gexp->file with a target passed explicitely and with a default target.
* gexp: Add 'raw-derivation-file'.Ludovic Courtès2020-01-04
| | | | | | | * guix/gexp.scm (<raw-derivation-file>): New record type. (raw-derivation-file-compiler): New gexp compiler. * tests/gexp.scm ("lower-gexp, raw-derivation-file") ("raw-derivation-file"): New tests.
* gexp: Allow character literals in GEXP->SEXP.Marius Bakke2019-12-18
| | | | | | | | | Fixes <https://bugs.gnu.org/38628>. * tests/gexp.scm ("lower-gexp, character literal"): New test. * guix/gexp.scm (gexp->sexp)[self-quoting?]: Add CHAR? to the tested types. * guix/repl.scm (self-quoting?): Likewise. * gnu/tests.scm (marionette-shepherd-service)[self-quoting?]: Likewise.
* gexp: 'local-file' properly resolves non-literal relative file names.Ludovic Courtès2019-11-30
| | | | | | | | * guix/gexp.scm (local-file): Distinguish the case where FILE is a literal string and when it's not. Add a clause for when FILE is not a literal string. * tests/gexp.scm ("local-file, non-literal relative file name"): New test. * doc/guix.texi (G-Expressions): Update accordingly.
* gexp: Catch and report non-self-quoting gexp inputs.Ludovic Courtès2019-09-23
| | | | | | | | | | | Previously we would, for example, generate build scripts in the store; when trying to run them, we'd get a 'read' error due to the presence of #<foo> syntax in there. * guix/gexp.scm (gexp->sexp)[self-quoting?]: New procedure. [reference->sexp]: Check whether the argument in a <gexp-input> box is self-quoting. Raise a '&gexp-input-error' condition if it's not. * tests/gexp.scm ("lower-gexp, non-self-quoting input"): New test.
* gexp: 'program-file' honors the current system and cross-compilation target.Ludovic Courtès2019-07-26
| | | | | | | | | | | | Fixes <https://bugs.gnu.org/36813>. Reported by Jakob L. Kreuze <zerodaysfordays.sdf.org@sdf.org>. * guix/gexp.scm (program-file-compiler): Pass #:system and #:target to 'gexp->script'. (load-path-expression): Add #:system and #:target and honor them. (gexp->script): Likewise. * tests/gexp.scm ("program-file #:system"): New test. * doc/guix.texi (G-Expressions): Adjust accordingly.
* gexp: 'lowered-gexp-guile' now returns a <derivation-input>.Ludovic Courtès2019-07-15
| | | | | | | | | * guix/derivations.scm (derivation-input-output-path): New procedure. * guix/gexp.scm (lower-gexp): Wrap GUILE in a <derivation-input>. (gexp->derivation): Adjust accordingly. * guix/remote.scm (remote-pipe-for-gexp, remote-eval): Adjust accordingly. * tests/gexp.scm ("lower-gexp"): Adjust accordingly.
* gexp: <lowered-gexp> separates sources from derivation inputs.Ludovic Courtès2019-07-15
| | | | | | | | | | | | | | | | | * guix/gexp.scm (lower-inputs): Return either <derivation-input> records or store items. (lower-reference-graphs): Return file/input pairs. (<lowered-gexp>)[sources]: New field. (lower-gexp): Adjust accordingly. (gexp->input-tuple): Remove. (gexp->derivation)[graphs-file-names]: Handle only the 'derivation-input?' and 'string?' cases. Pass #:sources to 'raw-derivation'; ensure #:inputs contains only <derivation-input> records. * guix/remote.scm (remote-eval): Adjust to the new <lowered-gexp> interface. * tests/gexp.scm ("lower-gexp"): Adjust to expect <derivation-input> records instead of <gexp-input>
* gexp: Add 'lower-gexp' and express 'gexp->derivation' in terms of it.Ludovic Courtès2019-07-04
| | | | | | | | | | | | | | | * guix/gexp.scm (gexp-input-thing, gexp-input-output) (gexp-input-native?): Export. (lower-inputs): Return <gexp-input> records instead of tuples. (lower-reference-graphs): Adjust accordingly. (<lowered-gexp>): New record type. (lower-gexp, gexp-input->tuple): New procedure. (gexp->derivation)[%modules]: Remove. [requested-graft?]: New variable. [add-modules]: New procedure. Rewrite in terms of 'lower-gexp'. (gexp-inputs): Add TODO comment. * tests/gexp.scm ("lower-gexp"): New test.
* store: Rename '&nix-error' to '&store-error'.Ludovic Courtès2019-01-21
| | | | | | | | | | | | | | | | | | | * guix/store.scm (&nix-error): Rename to... (&store-error): ... this, and adjust users. (&nix-connection-error): Rename to... (&store-connection-error): ... this, and adjust users. (&nix-protocol-error): Rename to... (&store-protocol-error): ... this, adjust users. (&nix-error, &nix-connection-error, &nix-protocol-error): Define these condition types and their getters as deprecrated aliases. * build-aux/run-system-tests.scm, guix/derivations.scm, guix/grafts.scm, guix/scripts/challenge.scm, guix/scripts/graph.scm, guix/scripts/lint.scm, guix/scripts/offload.scm, guix/serialization.scm, guix/ssh.scm, guix/tests.scm, guix/ui.scm, tests/derivations.scm, tests/gexp.scm, tests/guix-daemon.sh, tests/packages.scm, tests/store.scm, doc/guix.texi: Adjust to use the new names.
* gexp: Lowering a <computed-file> honors SYSTEM and TARGET.Ludovic Courtès2019-01-05
| | | | | | * guix/gexp.scm (computed-file-compiler): Pass #:system and #:target to 'gexp->derivation'. * tests/gexp.scm ("lower-object, computed-file, #:system"): New test.
* Merge branch 'master' into core-updatesMarius Bakke2018-11-29
|\
| * derivations: Add properties.Ludovic Courtès2018-11-28
| | | | | | | | | | | | | | | | | | | | | | | | * guix/derivations.scm (derivation): Add #:properties parameter. [user+system-env-vars]: Honor it. (derivation-properties): New procedure. (build-expression->derivation): Add #:properties and pass it to 'derivation'. * guix/gexp.scm (gexp->derivation): Likewise. * tests/derivations.scm ("derivation-properties"): New test. * tests/gexp.scm ("gexp->derivation properties"): New test. * doc/guix.texi (Derivations, G-Expressions): Adjust accordingly.
* | Merge branch 'master' into core-updatesMarius Bakke2018-11-14
|\|
| * tests: Add 'test-assertm' to (guix tests).Ludovic Courtès2018-11-12
| | | | | | | | | | | | | | | | | | * guix/tests.scm (test-assertm): New macro. * tests/gexp.scm (test-assertm): Remove. * tests/profiles.scm (test-assertm): Remove. * tests/challenge.scm (%store, test-assertm): Remove. * tests/debug-link.scm (%store, test-assertm): Remove. * tests/size.scm (%store, test-assertm): Remove.
* | Merge branch 'master' into core-updatesMarius Bakke2018-11-05
|\|
| * gexp: 'gexp-modules' now consistently deletes duplicates.Ludovic Courtès2018-10-27
| | | | | | | | | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/32966>. Reported by Clément Lassieur <clement@lassieur.org>. * guix/gexp.scm (gexp-attribute): Add 'equal?' optional parameter; pass it to 'delete-duplicates'. (gexp-modules)[module=?]: New procedure. Pass it to 'gexp-attribute'. * tests/gexp.scm ("gexp-modules deletes duplicates"): New test.
* | Merge branch 'master' into core-updatesMarius Bakke2018-10-05
|\|
| * tests: Update (guix build store-copy) tests.Ludovic Courtès2018-09-27
| | | | | | | | | | | | | | | | This is a followup to a387b0bebb151a766ca6a454a891f2370c96703c. * tests/gexp.scm ("gexp->derivation, store copy") ("gexp->derivation #:references-graphs"): Add (guix progress) and (guix records) to the imported modules.
* | Merge branch 'master' into core-updatesMarius Bakke2018-09-09
|\|
| * gexp: 'file-union' accepts directory names.Ludovic Courtès2018-09-08
| | | | | | | | | | | | * guix/gexp.scm (file-union): Import (guix build utils). Make the parent directories of TARGET. * tests/gexp.scm ("file-union"): New test.
* | gexp: Remove backward compatibility hack for 'imported-files'.Ludovic Courtès2018-07-26
|/ | | | | | | * guix/gexp.scm (gexp->derivation): Remove #:import-creates-derivation?. (imported-files): Remove #:derivation? and adjust callers. (imported-modules), compiled-modules): Likewise. * guix/packages.scm (patch-and-repack): Adjust 'gexp->derivation' call.
* gexp: 'imported-files/derivation' can copy files instead of symlinking.Ludovic Courtès2018-07-19
| | | | | | | | * guix/gexp.scm (imported-files/derivation): Add #:symlink? and honor it. (imported-files): Pass #:symlink? to 'imported-files/derivation'. * tests/gexp.scm ("imported-files with file-like objects"): Add 'file=?' and use it instead of calling 'readlink'.
* gexp: 'imported-files' no longer creates a derivation by default.Ludovic Courtès2018-07-19
| | | | | | | | | | | | | | | | | | * guix/gexp.scm (gexp->derivation): Add #:import-creates-derivation?. Pass #:derivation? to 'imported-modules' and 'compiled-modules'. In -L argument, check whether MODULES is a derivation. (%not-slash): New variable. (file-mapping->tree): New procedure. (imported-files): Rename to... (imported-files/derivation): ... this. (imported-files): New procedure. Rewrite in terms of 'interned-file-tree' when possible; add #:derivation? parameter. (imported-modules, compiled-modules): Add #:derivation? parameter and pass it to 'imported-files'. * guix/packages.scm (patch-and-repack): Pass #:import-creates-derivation? to 'gexp->derivation'. * tests/gexp.scm ("imported-files"): Adjust to no longer expect a derivation.
* tests: Don't rely on temporary directories being permanent.Leo Famulari2018-07-13
| | | | | * tests/gexp.scm ("gexp->script #:module-path", "program-file #:module-path"): Use run-with-store.
* store-copy: 'read-reference-graph' returns a list of records.Ludovic Courtès2018-06-14
| | | | | | | | | | | | | | The previous implementation of 'read-reference-graph' was good enough for many use cases, but it discarded the graph structure, which is useful information in some cases. * guix/build/store-copy.scm (<store-info>): New record type. (read-reference-graph): Rewrite to return a list of <store-info>. (closure-size, populate-store): Adjust accordingly. * gnu/services/base.scm (references-file): Adjust accordingly. * gnu/system/vm.scm (system-docker-image): Likewise. * guix/scripts/pack.scm (squashfs-image, docker-image): Likewise. * tests/gexp.scm ("gexp->derivation #:references-graphs"): Likewise.
* gexp: Add 'with-extensions'.Ludovic Courtès2018-06-01
| | | | | | | | | | | | | | | | | | | | | | | * guix/gexp.scm (<gexp>)[extensions]: New field. (gexp-attribute): New procedure. (gexp-modules): Write in terms of 'gexp-attribute'. (gexp-extensions): New procedure. (gexp->derivation): Add #:effective-version. [extension-flags]: New procedure. Honor extensions of EXP. (current-imported-extensions): New syntax parameter. (with-extensions): New macro. (gexp): Honor CURRENT-IMPORTED-EXTENSIONS. (compiled-modules): Add #:extensions and honor it. (load-path-expression): Likewise. (gexp->script, gexp->file): Honor extensions. * tests/gexp.scm (%extension-package): New variable. ("gexp-extensions & ungexp") ("gexp-extensions & ungexp-splicing") ("gexp-extensions and literal Scheme object") ("gexp->derivation & with-extensions") ("program-file & with-extensions"): New tests. * doc/guix.texi (G-Expressions): Document 'with-extensions'.
* gexp: 'scheme-file' can splice expressions.Ludovic Courtès2018-04-11
| | | | | | | | | | * guix/gexp.scm (<scheme-file>)[splice?]: New field. (scheme-file): Add #:splice? and pass it to '%scheme-file'. (scheme-file-compiler): Pass SPLICE? to 'gexp->file'. (gexp->file): Add #:splice? and honor it. * tests/gexp.scm ("gexp->file + #:splice?"): New test. ("gexp->derivation & with-imported-module & computed module"): Use #:splice? #t.
* gexp: 'program-file' has a new #:module-path parameter.Ludovic Courtès2018-03-23
| | | | | | | | * guix/gexp.scm (<program-file>): Add 'path' field. (program-file): Add #:module-path parameter and honor it. (program-file-compiler): Honor the 'path' field. * tests/gexp.scm ("program-file #:module-path"): New test. * doc/guix.texi (G-Expressions): Update.
* gexp: 'gexp->script' and 'gexp->file' have a new #:module-path parameter.Ludovic Courtès2018-03-23
| | | | | | | | * guix/gexp.scm (load-path-expression): Add 'path' optional parameter. (gexp->script): Add #:module-path and honor it. (gexp->file): Likewise. * tests/gexp.scm ("gexp->script #:module-path"): New test. * doc/guix.texi (G-Expressions): Update accordingly.
* gexp: 'ungexp-splicing' properly accounts for nested native inputs.Ludovic Courtès2017-07-17
| | | | | | | | | | Previously, (gexp-native-inputs #~#$@(list #~#+foo)) would return '(). This is a followup to 5b14a7902c58d9fb7923f9e16871f549fbe59b6e. * guix/gexp.scm (gexp-inputs)[add-reference-inputs]: In the list case, remove 'if' around 'fold-right'. In 'map' lambda, always inherit N?. * tests/gexp.scm ("gexp list splicing + ungexp-splicing"): New test.
* gexp: 'gexp-modules' accepts plain Scheme objects.Ludovic Courtès2017-04-19
| | | | | * guix/gexp.scm (gexp-modules): Return '() when not (gexp? GEXP). * tests/gexp.scm ("gexp-modules and literal Scheme object"): New test.
* gexp: 'lower-object' raises an exception when passed an invalid object.Ludovic Courtès2017-04-04
| | | | | | | * guix/gexp.scm (&gexp-error, &gexp-input-error): New error conditions. (lower-object): Raise &gexp-input-error when 'lookup-compiler' returns #f. * tests/gexp.scm ("lower-object & gexp-input-error?"): New test. * guix/ui.scm (call-with-error-handling): Add case for 'gexp-input-error?'.
* gexp: Add '=>' syntax to import computed modules.Ludovic Courtès2017-03-16
| | | | | | | | | | * guix/gexp.scm (imported-files)[file-pair]: Add case for pairs where the cdr is not a string. (imported-modules): Support '=>' syntax in MODULES. * tests/gexp.scm ("imported-files with file-like objects") ("gexp->derivation & with-imported-module & computed module"): New tests. * doc/guix.texi (G-Expressions): Document '=>' syntax for 'with-imported-modules'.
* gexp: Support 'ungexp' forms in improper lists.Ludovic Courtès2017-01-01
| | | | | | | * guix/gexp.scm (gexp)[collect-escapes, substitute-references]: Replace the (exp0 exp ...) patterns with (exp0 . exp) to match improper lists. Adjust clause bodies accordingly. * tests/gexp.scm ("one input package, dotted list"): New test.
* gexp: Native inputs of nested gexps are properly accounted for.Ludovic Courtès2016-12-19
| | | | | | | | | | | | | | | | | | | Previously, 'gexp-native-inputs' would not return the native inputs of nested gexps. For example, this: (gexp-native-inputs #~(foo #$#~(bar #+coreutils))) would return '(). * guix/gexp.scm (gexp-inputs)[add-reference-inputs]: In the non-recursive cases, check whether N? and NATIVE? are the same, and act accordingly. [native-input?]: Remove. Fold over all of (gexp-references exp). * tests/gexp.scm ("ungexp + ungexp-native, nested, special mixture"): New test. * tests/gexp.scm ("input list splicing + ungexp-native-splicing"): Pass #:native? #t to 'gexp-input'.
* store: Add 'references*'.Ludovic Courtès2016-11-19
| | | | | | | | | | | * guix/store.scm (references*): New procedure. * guix/profiles.scm (manifest-lookup-package)[references*]: Remove. * guix/scripts/system.scm (references*): Remove. * tests/gexp.scm ("gexp->file", "gexp->file + file-append") ("gexp->derivation", "gexp->derivation, cross-compilation") ("gexp->derivation, ungexp + ungexp-native") ("scheme-file", "text-file*", "mixed-text-file"): Remove 'references*' instead of (store-lift references).
* gexp: Add 'file-append'.Ludovic Courtès2016-09-09
| | | | | | | | | | * guix/gexp.scm (<file-append>): New record type. (file-append): New procedure. (file-append-compiler): New gexp compiler. * tests/gexp.scm ("file-append", "file-append, output") ("file-append, nested", "gexp->file + file-append"): New tests. * doc/guix.texi (G-Expressions): Use it in 'nscd' and 'list-files' examples. Document 'file-append'.
* gexp: Remove more uses of #:modules.Ludovic Courtès2016-07-12
| | | | | | | | * guix/scripts/system.scm (switch-to-system): Adjust comment. * tests/gexp.scm ("gexp->derivation #:references-graphs"): Use 'with-imported-modules' instead of #:modules. * tests/grafts.scm ("graft-derivation, preserve empty directories"): Likewise.
* gexp: Add 'with-imported-modules' macro.Ludovic Courtès2016-07-12
| | | | | | | | | | | | | | | | | | | | | * guix/gexp.scm (<gexp>)[modules]: New field. (gexp-modules): New procedure. (gexp->derivation): Use it and append the result to %MODULES. Update docstring to mark #:modules as deprecated. (current-imported-modules, with-imported-modules): New macros. (gexp): Pass CURRENT-IMPORTED-MODULES as second argument to 'gexp'. (gexp->script): Use and honor 'gexp-modules'; define '%modules'. * tests/gexp.scm ("gexp->derivation & with-imported-modules") ("gexp->derivation & nested with-imported-modules") ("gexp-modules & ungexp", "gexp-modules & ungexp-splicing"): New tests. ("program-file"): Use 'with-imported-modules'. Remove #:modules argument to 'program-file'. * doc/guix.texi (G-Expressions): Document 'with-imported-modules'. Mark #:modules of 'gexp->derivation' as deprecated. * emacs/guix-devel.el: Add syntax for 'with-imported-modules'. (guix-devel-keywords): Add it. * .dir-locals.el: Likewise.
* gexp: Add 'local-file' file name resolution test.Ludovic Courtès2016-06-16
| | | | * tests/gexp.scm ("local-file, relative file name"): New test.
* gexp: Add #:select? parameter to 'local-file'.Ludovic Courtès2016-06-16
| | | | | | | | | * guix/gexp.scm (<local-file>)[select?]: New field. (true): New procedure. (%local-file): Add #:select? and honor it. (local-file): Likewise. * tests/gexp.scm ("local-file, #:select?"): New test. * doc/guix.texi (G-Expressions): Adjust accordingly.
* 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.
* gexp: Add #:disallowed-references.Ludovic Courtès2016-03-20
| | | | | | | | * guix/gexp.scm (gexp->derivation): Add #:disallowed-references and honor it. * tests/gexp.scm ("gexp->derivation #:disallowed-references, allowed") ("gexp->derivation #:disallowed-references"): New tests. * doc/guix.texi (G-Expressions): Adjust accordingly.
* tests: Disable grafting by default for most tests.Ludovic Courtès2016-03-06
| | | | | | | | | | | | | | | This allows tests to run as expected even in the presence of replacements among the bootstrap packages, such as Perl (commit d8173f21f7b4e3cb83541b8fa70621d2b6d4ce1c). * tests/cpan.scm: Add (%graft? #f). * tests/derivations.scm: Likewise. * tests/graph.scm: Likewise. * tests/monads.scm: Likewise. * tests/profiles.scm: Likewise. * tests/gexp.scm: Likewise. ("gexp->derivation vs. grafts"): Explicitly reenable grafting before, and disable it after, using 'set-grafting'.
* tests: Skip 'program-file' test when shebang is too long.Ludovic Courtès2015-11-04
| | | | * tests/gexp.scm ("program-file"): Skip when SHEBANG is too long.
* gexp: Add 'scheme-file'.Ludovic Courtès2015-10-10
| | | | | | | * guix/gexp.scm (<scheme-file>): New record type. (scheme-file, scheme-file-compiler): New procedures. * tests/gexp.scm ("scheme-file"): New test. * doc/guix.texi (G-Expressions): Document 'scheme-file'.
* gexp: Add 'mixed-text-file'.Ludovic Courtès2015-10-10
| | | | | | * guix/gexp.scm (mixed-text-file): New procedure. * tests/gexp.scm ("mixed-text-file"): New test. * doc/guix.texi (G-Expressions): Document it.