summaryrefslogtreecommitdiff
path: root/tests/monads.scm
AgeCommit message (Collapse)Author
2016-04-03build: Add a Guile custom test driver using SRFI-64.Mathieu Lirzin
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.
2016-03-06tests: Disable grafting by default for most tests.Ludovic Courtès
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'.
2015-09-04monads: Fix 'liftN' fallback case.Ludovic Courtès
Reported by Andy Wingo <wingo@igalia.com>. * guix/monads.scm (define-lift) <fallback case>: Add missing #'. Remove extra formal parameter. * tests/monads.scm ("lift"): Add test with 'lift1' as a procedure.
2015-06-08monads: Allow n-ary '>>=' expressions.Ludovic Courtès
Suggested by Federico Beffa <beffa@fbengineering.ch>. * guix/monads.scm (bind-syntax): New macro. (with-monad): Use it instead of 'identifier-syntax'. * tests/monads.scm (">>= with more than two arguments"): New test. * doc/guix.texi (The Store Monad): Explain that there can be several MPROC. Add an example.
2015-05-27monads: 'foldm', 'mapm', and 'anym' now take a list of regular values.Ludovic Courtès
* guix/monads.scm (foldm, mapm, anym): Change to take a list of regular values as is customary. * tests/monads.scm ("mapm", "anym"): Adjust accordingly.
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-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-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.
2014-10-08monads: Add 'mbegin'.Ludovic Courtès
* guix/monads.scm (mbegin): New macro. * tests/monads.scm ("mbegin"): New test. * doc/guix.texi (The Store Monad): Document it.
2014-10-05gnu: cross-base: Use the right dynamic linker name.Ludovic Courtès
* gnu/packages/cross-base.scm (cross-gcc-arguments): Parametrize %CURRENT-TARGET-SYSTEM. * tests/monads.scm ("package-file + package->cross-derivation"): Replace "foo64-gnu" with "mips64el-linux-gnu".
2014-08-23Factorize test suite support in (guix tests).Ludovic Courtès
* guix/tests.scm: New file. * Makefile.am (noinst_DATA): New variable. (GOBJECTS): Add guix/tests.go. * tests/builders.scm (%store): Use 'open-connection-for-tests' from (guix tests). * tests/derivations.scm: Likewise. * tests/monads.scm: Likewise. * tests/packages.scm: Likewise. * tests/profiles.scm: Likewise. * tests/union.scm: Likewise. * tests/gexp.scm: Likewise. (guile-for-build): Remove. Use (%guile-for-build) instead. * tests/nar.scm (make-random-bytevector, %seed, random-text): Remove. (populate-file): Change 'make-random-bytevector' to 'random-bytevector'. Use (guix tests). * tests/store.scm (%seed, random-text): Remove. Use (guix tests).
2014-08-17monads: 'package-file' uses '%current-system' at '>>=' time.Ludovic Courtès
* guix/monads.scm (package-file): Leave #:system to #f by default. * tests/monads.scm ("package-file, default system"): New test.
2014-08-17monads: Add 'package->cross-derivation' and #:target for 'package-file'.Ludovic Courtès
* guix/monads.scm (package-file): Add #:target keyword parameter and honor it. (package->cross-derivation): New procedure. * tests/monads.scm ("package-file + package->cross-derivation"): New test. * doc/guix.texi (The Store Monad): Update 'package-file' documentation. Add 'package->cross-derivation'.
2014-07-24monads: Add 'interned-file'.Ludovic Courtès
* guix/monads.scm (interned-file): New procedure. * tests/monads.scm ("interned-file"): New test. * doc/guix.texi (The Store Monad): Document it.
2014-07-12monads: Fix 'mapm' so that effects happen from left to right.Ludovic Courtès
* guix/monads.scm (mapm): Don't reverse LST, so that items are processed from left to right. Bind the result of 'foldm' and reverse it. * tests/monads.scm ("sequence"): Change 'frob' so it performs its side effect within an 'mlet' body. Adjust call accordingly.
2014-04-28monads: Hide 'derivation-expression' and 'lower-inputs'.Ludovic Courtès
* guix/monads.scm: Unexport 'lower-inputs' and 'derivation-expression'. (text-file*): Add comment about the switch to 'gexp->derivation'. (lower-inputs): Add comment about its doom. (derivation-expression): Likewise. * guix/gexp.scm (lower-inputs*): Rename to... (lower-inputs): ... this. Update callers. * tests/monads.scm (derivation-expression): New procedure. * doc/guix.texi (The Store Monad): Use 'gexp->derivation' instead of 'derivation-expression'. Remove documentation of 'derivation-expression'. * guix/ui.scm (read/eval): Use THE-ROOT-MODULE so that macros are properly expanded. * tests/guix-build.sh: Use 'gexp->derivation' instead of 'derivation-expression'.monads: Hide 'derivation-expression' and 'lower-inputs'.
2014-02-03monads: Add 'text-file*'.Ludovic Courtès
* guix/monads.scm (text-file*): New procedure. * tests/monads.scm ("text-file*"): New test. * doc/guix.texi (The Store Monad): Change example since the previous one would erroneously fail to retain a reference to Coreutils. Document 'text-file*'.
2013-12-10monads: Fix 'anym'.Ludovic Courtès
* guix/monads.scm (anym): Fix successful case. * tests/monads.scm ("anym"): New test.
2013-12-04derivations: Use more keyword parameters for 'build-expression->derivation'.Ludovic Courtès
* guix/derivations.scm (build-expression->derivation): Turn 'system' and 'inputs' into keyword parameters. Adjust callers accordingly. * gnu/system/linux.scm, gnu/system/vm.scm, guix/build-system/cmake.scm, guix/build-system/gnu.scm, guix/build-system/perl.scm, guix/build-system/python.scm, guix/build-system/trivial.scm, guix/download.scm, guix/packages.scm, guix/profiles.scm, guix/scripts/pull.scm, tests/derivations.scm, tests/guix-build.sh, tests/monads.scm, tests/store.scm, tests/union.scm: Adjust users of 'build-expression->derivation' and 'derivation-expression' accordingly. * doc/guix.texi (Derivations): Adjust 'build-expression->derivation' documentation accordingly. (The Store Monad): Likewise for 'derivation-expression'.
2013-10-03monads: Allow resolution of a monad's bind/return at expansion time.Ludovic Courtès
* guix/monads.scm (<monad>): Turn in a raw SRFI-9 record type. (define-monad): New macro. (with-monad): Add a case for when MONAD is a macro. (identity-return, identity-bind, store-return, store-bind): Inline. (%identity-monad, %store-monad): Use 'define-monad'. * tests/monads.scm ("monad?"): New test.
2013-10-03Add (guix monads).Ludovic Courtès
* guix/monads.scm: New file. * tests/monads.scm: New file. * Makefile.am (MODULES): Add guix/monads.scm. (SCM_TESTS): Add tests/monads.scm. * doc/guix.texi (The Store Monad): New node. (The Store): Reference it.