diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gexp.scm | 11 | ||||
-rw-r--r-- | tests/guix-package.sh | 14 | ||||
-rw-r--r-- | tests/guix-register.sh | 5 | ||||
-rw-r--r-- | tests/monads.scm | 14 |
4 files changed, 34 insertions, 10 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm index 60adf497ed..b0ff1019e6 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -211,6 +211,17 @@ (return (string=? (readlink (string-append out "/foo")) guile)))) +(test-assertm "gexp->derivation, default system" + ;; The default system should be the one at '>>=' time, not the one at + ;; invocation time. See <http://bugs.gnu.org/18002>. + (let ((system (%current-system)) + (mdrv (parameterize ((%current-system "foobar64-linux")) + (gexp->derivation "foo" + (gexp + (mkdir (ungexp output))))))) + (mlet %store-monad ((drv mdrv)) + (return (string=? system (derivation-system drv)))))) + (define shebang (string-append (derivation->output-path guile-for-build) "/bin/guile --no-auto-compile")) diff --git a/tests/guix-package.sh b/tests/guix-package.sh index de545801de..4d75955411 100644 --- a/tests/guix-package.sh +++ b/tests/guix-package.sh @@ -189,11 +189,14 @@ test "`readlink_base "$profile"`" = "$generation" XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" export XDG_CACHE_HOME -HOME="t-home-$$" +HOME="$PWD/t-home-$$" export HOME mkdir -p "$HOME" +# Get the canonical directory name so that 'guix package' recognizes it. +HOME="`cd $HOME; pwd -P`" + guix package --bootstrap -i guile-bootstrap test -L "$HOME/.guix-profile" test -f "$HOME/.guix-profile/bin/guile" @@ -224,6 +227,15 @@ do test "`readlink "$default_profile"`" = "$default_profile-0-link" done +# Check whether '-p ~/.guix-profile' makes any difference. +# See <http://bugs.gnu.org/17939>. +if test -e "$HOME/.guix-profile-0-link"; then false; fi +if test -e "$HOME/.guix-profile-1-link"; then false; fi +guix package --bootstrap -p "$HOME/.guix-profile" -i guile-bootstrap +if test -e "$HOME/.guix-profile-1-link"; then false; fi +guix package --bootstrap --roll-back -p "$HOME/.guix-profile" +if test -e "$HOME/.guix-profile-0-link"; then false; fi + # Extraneous argument. if guix package install foo-bar; then false; else true; fi diff --git a/tests/guix-register.sh b/tests/guix-register.sh index 019a451b3b..28b799b5c1 100644 --- a/tests/guix-register.sh +++ b/tests/guix-register.sh @@ -57,8 +57,8 @@ guile -c " # mkdir -p "$new_store/$storedir" -new_store_dir="`cd "$new_store/$storedir" ; pwd`" -new_store="`cd "$new_store" ; pwd`" +new_store_dir="`cd "$new_store/$storedir" ; pwd -P`" +new_store="`cd "$new_store" ; pwd -P`" to_copy="`guix build guile-bootstrap`" cp -r "$to_copy" "$new_store_dir" @@ -81,7 +81,6 @@ guix-register --prefix "$new_store" "$closure" # Now make sure this is recognized as valid. -NIX_IGNORE_SYMLINK_STORE=1 NIX_STORE_DIR="$new_store_dir" NIX_STATE_DIR="$new_store$localstatedir" NIX_LOG_DIR="$new_store$localstatedir/log/guix" diff --git a/tests/monads.scm b/tests/monads.scm index 82f4b9989c..ac19d33f93 100644 --- a/tests/monads.scm +++ b/tests/monads.scm @@ -166,14 +166,16 @@ (let* ((input (iota 100)) (order '())) (define (frob i) - ;; The side effect here is used to keep track of the order in - ;; which monadic values are bound. - (set! order (cons i order)) - i) + (mlet monad ((foo (return 'foo))) + ;; The side effect here is used to keep track of the order in + ;; which monadic values are bound. Perform the side effect + ;; within a '>>=' so that it is performed when the return + ;; value is actually bound. + (set! order (cons i order)) + (return i))) (and (equal? input - (run (sequence monad - (map (lift1 frob monad) input)))) + (run (sequence monad (map frob input)))) ;; Make sure this is from left to right. (equal? order (reverse input))))) |