aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2015-02-26ui: Honor --no-* options passed via $GUIX_BUILD_OPTIONS.Ludovic Courtès
Reported by Alex Kost <alezost@gmail.com> at <http://lists.gnu.org/archive/html/guix-devel/2015-02/msg00702.html>. * guix/ui.scm (parse-command-line)[parse-options-from]: Add 'seeds' parameter. Thread the result of the first 'parse-options-from' call to the second.
2015-02-26ui: Factorize command-line + env. var. option parsing.Ludovic Courtès
* guix/ui.scm (%default-argument-handler, parse-command-line): New procedures. (environment-build-options): Make private. * guix/scripts/archive.scm (guix-archive)[parse-options, parse-options-from]: Remove. Use 'parse-command-line' instead. * guix/scripts/build.scm (guix-build): Likewise. * guix/scripts/environment.scm (guix-environment): Likewise. * guix/scripts/package.scm (guix-package): Likewise. * guix/scripts/system.scm (guix-system): Likewise. * tests/ui.scm (with-environment-variable): New macro. ("parse-command-line"): New test.
2015-02-24tests: Skip tests that would fail due to the shebang length.Ludovic Courtès
Reported by Daniel Kochmański <dkochmanski@hellsgate.pl>. Fixes <http://bugs.gnu.org/19888>. * guix/tests.scm (shebang-too-long?): New procedure. * tests/builders.scm ("gnu-build"): Conditionalize on not (shebang-too-long?). * tests/packages.scm ("GNU Make, bootstrap"): Likewise. * tests/guix-package.sh (shebang_not_too_long): New function. Use it to determine whether to build 'gnu-make-boot0'.
2015-02-24tests: Factorize the network reachability test.Ludovic Courtès
* guix/tests.scm (network-reachable?): New procedure. * tests/builders.scm (network-reachable?): Remove. Replace references to it with calls to the new 'network-reachable?' procedure. * tests/derivations.scm (%coreutils): Use 'network-reachable?' instead of 'getaddrinfo'. * tests/packages.scm: Likewise. * tests/union.scm: Likewise.
2015-02-20import: cpan: Update tests for dependency handling.Eric Bavier
* tests/cpan.scm (test-json): Remove core module dependencies. [cpan->guix-package]: Add mock url handling for module api. Adjust expected native-inputs and license.
2015-02-13gexp: Add #:graft? parameter to 'gexp->derivation'.Ludovic Courtès
* guix/gexp.scm (gexp->derivation): Add #:graft? parameter and honor it. * tests/gexp.scm ("gexp->derivation vs. grafts"): New test. * doc/guix.texi (G-Expressions): Update 'gexp->derivation' documentation.
2015-02-13gexp: Implement 'imported-modules' & co. using 'gexp->derivation'.Ludovic Courtès
* guix/derivations.scm (imported-files): Keep private. (%imported-modules, %compiled-modules, build-expression->derivation): Mark as deprecated. (imported-modules, compiled-modules): Remove. * guix/gexp.scm (%mkdir-p-definition): New variable. (imported-files, search-path*, imported-modules, compiled-modules): New procedures. * tests/derivations.scm ("imported-files"): Remove. * tests/gexp.scm ("imported-files", "gexp->derivation #:modules"): New tests.
2015-02-11gexp: Add #:allowed-references parameter to 'gexp->derivation'.Ludovic Courtès
* guix/gexp.scm (lower-references): New procedure. (gexp->derivation): Add #:allowed-references and honor it. * tests/gexp.scm ("gexp->derivation #:allowed-references", "gexp->derivation #:allowed-references, disallowed"): New tests. * doc/guix.texi (G-Expressions): Update 'gexp->derivation' doc.
2015-02-09profiles: Report "pseudo-upgrades" as upgrades, not downgrades.Ludovic Courtès
Reported by Andreas Enge <andreas@enge.fr> at <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19764#19>. * guix/profiles.scm (manifest-transaction-effects): Use 'version>=?' instead of 'version>?'. * tests/profiles.scm ("manifest-transaction-effects and pseudo-upgrades"): New test.
2015-02-08profiles: Distinguish downgrades from upgrades.Ludovic Courtès
Fixes <http://bugs.gnu.org/19764>. * guix/profiles.scm (manifest-transaction-effects): Return downgraded packages as a fourth value. * guix/ui.scm (show-manifest-transaction): Adjust accordingly. * tests/profiles.scm ("manifest-transaction-effects and downgrades"): New test.
2015-02-08ui: Simplify 'show-manifest-transaction' test.Ludovic Courtès
* tests/ui.scm ("show-manifest-transaction"): Remove useless call to 'manifest-transaction-effects'.
2015-02-07serialization: Check for EOF and incomplete input conditions.Ludovic Courtès
Fixes <http://bugs.gnu.org/19756>. Reported by <sleep_walker@suse.cz>. * guix/serialization.scm (currently-restored-file): New variable. (get-bytevector-n*): New procedure. (read-int, read-long-long, read-string, read-latin1-string, read-contents): Use it instead of 'get-bytevector-n'. (restore-file): Parameterize 'currently-restored-file' and set it. * tests/nar.scm ("restore-file with incomplete input"): New test.
2015-02-06tests: Disable grafts when comparing derivations.Ludovic Courtès
Fixes a regression introduced with the grafting of Patch in 3f11f01. * tests/packages.scm ("reference to non-existent output"): Wrap in 'parameterize'.
2015-02-06guix package: Make custom profiles actual indirect roots.Ludovic Courtès
Before that, any profile generation built when '-p' is used would effectively become a permanent GC root because the symlink in /var/guix/gcroots/auto would point directly to /gnu/store/...-profile. * guix/scripts/package.scm (maybe-register-gc-root): Rename to... (register-gc-root): ... this. Remove conditional, and replace call to 'canonicalize-path' with (string-append (getcwd) "/" ...). (guix-package): Call 'register-gc-root' only if PROFILE is different from %CURRENT-PROFILE. * tests/guix-package.sh: Add test case.
2015-02-02tests: Skip 'guix-register' when the socket name length is exceeded.Ludovic Courtès
* tests/guix-register.sh: Before running 'guix-daemon', check whether the socket name length exceeds the system limitation.
2015-02-02tests: Don't dump the list of dead items in the test log.Ludovic Courtès
* tests/store.scm ("dead-paths"): Wrap result in '->bool'.
2015-02-02store: Add 'build-things'.Ludovic Courtès
* guix/store.scm (operation-id): Rename 'build-derivations' to 'build-things', as per Nix commit 1aba0bf0. (build-derivations): Rename to... (build-things): ... this. Keep 'build-derivations' as an alias. (build): New procedure. * tests/store.scm ("build-things with output path", "substitute + build-things with output path"): New tests.
2015-02-02tests: Add 'with-derivation-substitute' and use it.Ludovic Courtès
* guix/tests.scm (%substitute-directory): New variable. (call-with-derivation-narinfo): Use it. (call-with-derivation-substitute): New procedure. (with-derivation-substitute): New macro. * tests/store.scm ("substitute"): Use 'with-derivation-substitute'. ("substitute, corrupt output hash"): Likewise.
2015-02-02tests: Further factorize substitute mocks.Ludovic Courtès
* guix/tests.scm (derivation-narinfo): Turn 'nar' into a keyword parameter. Add #:sha256 parameter, and honor it. (call-with-derivation-narinfo): Add #:sha256 and pass it to 'derivation-narinfo'. (with-derivation-narinfo): Extend with support for (sha256 => value). * tests/store.scm ("substitute query"): Use 'with-derivation-narinfo'. ("substitute"): Likewise. ("substitute, corrupt output hash"): Likewise. ("substitute --fallback"): Likewise. * tests/derivations.scm: Remove Emacs local variable.
2015-02-02tests: Use 'with-store' as appropriate.Ludovic Courtès
* tests/store.scm ("no substitutes", "substitute query", "substitute", "substitute, corrupt output hash", "substitute --fallback"): Use 'with-store' instead of 'open-connection'.
2015-01-28lint: Fix argument parsing when several packages are specified.Ludovic Courtès
* guix/scripts/lint.scm (%options) <--checkers>: Remove 'arg-handler' parameter, and return a single value. (guix-lint)[parse-options]: Remove 'arg-handler' parameter from handlers. Remove second seed to 'args-fold*'. * tests/guix-lint.sh: Add test.
2015-01-24derivations: Raise an error for references to non-existent outputs.Ludovic Courtès
Fixes <http://bugs.gnu.org/19630>. Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>. * guix/derivations.scm (&derivation-error, &derivation-missing-output-error): New error conditions. (derivation->output-path): Raise a '&derivation-missing-output-error' if OUTPUT is not an output of DRV. * guix/ui.scm (call-with-error-handling): Add case for 'derivation-missing-output-error?'. (show-what-to-build): Check whether (derivation-outputs drv) is empty. * tests/packages.scm ("reference to non-existent output"): Add test.
2015-01-20gnu: 'search-patch' raises an error when a patch is not found.Ludovic Courtès
* gnu/packages.scm (search-patch): Raise an error condition when 'search-path' returns #f. * tests/packages.scm ("patch not found yields a run-time error"): New test.
2015-01-19records: Add support for delayed fields.Ludovic Courtès
* guix/records.scm (make-syntactic-constructor): Add #:delayed parameter. [delayed-field?]: New procedure. [wrap-field-value]: Use it. (define-record-type*)[delayed-field?, wrapped-field?]: New procedures. [thunked-field-accessor-name]: Rename to... [wrapped-field-accessor-name]: ... this. [field-spec->srfi-9]: Change 'thunked' to 'wrapped'. [delayed-field-accessor-definition]: New procedure. Compute delayed-field accessors and emit them. Pass #:delayed to 'make-syntactic-constructor'. * tests/records.scm ("define-record-type* & delayed", "define-record-type* & delayed & default", "define-record-type* & delayed & inherited"): New tests.
2015-01-19tests: Adjust syscall tests for 2.6ish Linux.Ludovic Courtès
* tests/syscalls.scm ("set-network-interface-flags", "set-network-interface-address"): Accept EACCES as a valid result.
2015-01-17monads: Add the state monad.Ludovic Courtès
* guix/monads.scm (state-return, state-bind, run-with-state, current-state, set-current-state, state-push, state-pop): New procedures. (%state-monad): New variable. * tests/monads.scm (%monads): Add %STATE-MONAD. (%monad-run): Add 'run-with-state'. (values->list): New macro. ("set-current-state", "state-push etc."): New tests.
2015-01-17store: Add #:recursive? parameter to 'export-paths'.Ludovic Courtès
* guix/store.scm (export-paths): Add #:recursive? parameter and honor it. * tests/store.scm ("export/import incomplete", "export/import recursive"): New tests.
2015-01-16Merge branch 'core-updates'Ludovic Courtès
Conflicts: gnu/packages/bootstrap.scm
2015-01-14packages: Convert source derivations to monadic style.Ludovic Courtès
* guix/packages.scm (origin->derivation): Take body from 'package-source-derivation', and change it to monadic style. Expect METHOD to a monadic procedure. (package-source-derivation): Define in terms of 'origin->derivation'. * guix/download.scm (url-fetch): Remove 'store' argument. Remove 'guile-for-build' variable. Turn into a monadic procedure. * guix/git-download.scm (git-fetch): Likewise. * guix/svn-download.scm (svn-fetch): Likewise. * tests/builders.scm (url-fetch*): New procedure. Change tests to call 'url-fetch*' instead of 'url-fetch'. * tests/packages.scm ("package-source-derivation, snippet"): Remove 'store' parameter of 'fetch' and change it to use 'interned-file' instead of 'add-to-store'. * gnu/packages/bootstrap.scm (bootstrap-origin)[boot]: Remove 'store' parameter.
2015-01-14store: Add 'store-lower'.Ludovic Courtès
* guix/store.scm (store-lower): New procedure. * tests/store.scm ("store-lower"): New test.
2015-01-14monads: Move '%store-monad' and related procedures where they belong.Ludovic Courtès
This turns (guix monads) into a generic module for monads, and moves the store monad and related monadic procedures in their corresponding module. * guix/monads.scm (store-return, store-bind, %store-monad, store-lift, text-file, interned-file, package-file, package->derivation, package->cross-derivation, origin->derivation, imported-modules, compiled, modules, built-derivations, run-with-store): Move to... * guix/store.scm (store-return, store-bind, %store-monad, store-lift, text-file, interned-file): ... here. (%guile-for-build): New variable. (run-with-store): Moved from monads.scm. Remove default value for #:guile-for-build. * guix/packages.scm (default-guile): Export. (set-guile-for-build): New procedure. (package-file, package->derivation, package->cross-derivation, origin->derivation): Moved from monads.scm. * guix/derivations.scm (%guile-for-build): Remove. (imported-modules): Rename to... (%imported-modules): ... this. (compiled-modules): Rename to... (%compiled-modules): ... this. (built-derivations, imported-modules, compiled-modules): New procedures. * gnu/services/avahi.scm, gnu/services/base.scm, gnu/services/dbus.scm, gnu/services/dmd.scm, gnu/services/networking.scm, gnu/services/ssh.scm, gnu/services/xorg.scm, gnu/system/install.scm, gnu/system/linux-initrd.scm, gnu/system/shadow.scm, guix/download.scm, guix/gexp.scm, guix/git-download.scm, guix/profiles.scm, guix/svn-download.scm, tests/monads.scm: Adjust imports accordingly. * guix/monad-repl.scm (default-guile-derivation): New procedure. (store-monad-language, run-in-store): Use it. * build-aux/hydra/gnu-system.scm (qemu-jobs): Add explicit 'set-guile-for-build' call. * guix/scripts/archive.scm (derivation-from-expression): Likewise. * guix/scripts/build.scm (options/resolve-packages): Likewise. * guix/scripts/environment.scm (guix-environment): Likewise. * guix/scripts/system.scm (guix-system): Likewise. * doc/guix.texi (The Store Monad): Adjust module names accordingly.
2015-01-13Merge branch 'master' into core-updatesMark H Weaver
2015-01-13tests: Properly synchronize threads in the 'home-page' lint tests.Ludovic Courtès
* tests/lint.scm (%http-server-lock, %http-server-ready): New variables. (http-open): New procedure. (stub-http-server): Use it. (call-with-http-server): Wrap body in 'with-mutex'. Call 'wait-condition-variable' after 'make-thread'.
2015-01-12monads: Remove 'derivation-expression'.Ludovic Courtès
* guix/monads.scm (lower-inputs, derivation-expression): Remove. * tests/monads.scm (derivation-expression, "mlet* + derivation-expression"): Remove.
2015-01-12monads: Rewrite 'text-file*' using gexps.Ludovic Courtès
* guix/monads.scm (text-file*): Move to... * guix/gexp.scm (text-file*): ... here. Rewrite using gexps. * tests/monads.scm ("text-file*"): Move to... * tests/gexp.scm ("text-file*"): ... here.
2015-01-11Add (guix sets).Ludovic Courtès
* guix/sets.scm, tests/sets.scm: New files.sets * Makefile.am (MODULES, SCM_TESTS): Add them.
2015-01-11Merge branch 'master' into core-updatesMark H Weaver
2015-01-10derivations: Add 'substitution-oracle' and use it.Ludovic Courtès
This makes 'guix environment PACKAGE' significantly faster when substitutes are enabled. Before that, it would lead to many invocations of 'guix substitute-binary', one per 'derivation-prerequisites-to-build' call. Now, all these are replaced by a single invocation. * guix/derivations.scm (derivation-output-paths, substitution-oracle): New procedures. (derivation-prerequisites-to-build): Replace #:use-substitutes? with #:substitutable?. Remove the local 'derivation-output-paths' and 'substitutable?'. * guix/ui.scm (show-what-to-build): Add 'substitutable?'. Pass it to 'derivation-prerequisites-to-build'. [built-or-substitutable?]: Use it instead of 'has-substitutes?'. * tests/derivations.scm ("derivation-prerequisites-to-build and substitutes"): Use #:substitutable? instead of #:use-substitutes?.
2015-01-09derivations: Add 'derivation-output-names'.Ludovic Courtès
* guix/derivations.scm (derivation-output-names): New procedure. (derivation-prerequisites-to-build): Use it for #:outputs. (map-derivation): Likewise. * tests/derivations.scm ("derivation-output-names"): New test.
2015-01-09import: Add CPAN importer.Eric Bavier
* guix/import/cpan.scm, guix/scripts/import/cpan.scm, tests/cpan.scm: New files. * Makefile.am (MODULE)[HAVE_GUILE_JSON]: Add them. * guix/scripts/import.scm (importers): Add cpan. * doc/guix.texi (Requirements): Mention `guix import cpan` as a user of guile-json. (Invoking guix import): Document new `guix import cpan` command.
2015-01-09tests: import: Factorize utility function.Eric Bavier
* tests/pypi.scm (mock): Move this... * guix/tests.scm: to here.
2015-01-09import: Factorize utility functions.Eric Bavier
* guix/import/pypi.scm (hash-table->alist, flatten, assoc-ref*, url-fetch, json-fetch): Pull procedures from here into... * guix/import/utils.scm: Here and... * guix/import/json.scm: Here. New file. * Makefile.am (MODULE)[HAVE_GUILE_JSON]: Add it. * guix/import/gnu.scm (file-sha256): Move from here to... * guix/hash.scm: Here. * tests/pypi.scm (pypi->guix-package): Update mock module reference.
2015-01-07tests: Add missing copyright line.Ludovic Courtès
* tests/lint.scm: Add missing copyright line for commit 907c98ac and others.
2015-01-06Merge branch 'master' into core-updatesMark H Weaver
2015-01-03gnu: Search for patches under $GUIX_PACKAGE_PATH.Ludovic Courtès
Fixes <http://bugs.gnu.org/19364>. Reported by Tomáš Čech <sleep_walker@suse.cz> and Mark H Weaver <mhw@netris.org>. * gnu/packages.scm (%patch-path): Move after definition of %package-module-path'. Append "/gnu/packages/patches" only to %DISTRO-ROOT-DIRECTORY. * tests/guix-package.sh: Add 'emacs-foo-bar-patched' test.
2015-01-03guix package: Follow symlinks for pattern search paths.Ludovic Courtès
* guix/scripts/package.scm (search-path-environment-variables): Add local 'files' variable. * tests/packages.scm ("--search-paths with pattern"): New test.
2014-12-30Merge branch 'master' into core-updatesMark H Weaver
2014-12-29tests: Make the 'lint' tests slightly more concise.Ludovic Courtès
* tests/lint.scm (with-warnings): New macro. Replace all uses of 'call-with-warnings' with the corresponding 'with-warnings' form.
2014-12-29tests: Factorize the 'dummy-package' macro.Ludovic Courtès
* guix/tests.scm (dummy-package): New macro. * tests/lint.scm (dummy-package): Remove. * tests/packages.scm (dummy-package): Remove.
2014-12-29lint: Add tests for the 'home-page' checker.Ludovic Courtès
Suggested by Cyril Roelandt <tipecaml@gmail.com>. * tests/lint.scm (%http-server-port, %http-server-socket, %local-url, stub-http-server): New variables. (http-write, call-with-http-server): New procedures. (with-http-server): New macro. ("home-page: wrong home-page", "home-page: invalid URI", "home-page: host not found", "home-page: Connection refused", "home-page: 200", "home-page: 404"): New tests. * guix/scripts/lint.scm (check-home-page): Export.