diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2016-12-20 19:06:22 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2016-12-20 19:14:41 +0100 |
| commit | f943c317fb714075b455d4a30f631c8cb45732b4 (patch) | |
| tree | 7f70c29bb007f7e81f0e2884d1307237de59e6b2 /tests/guix-environment.sh | |
| parent | 7d2511bc6b467c056e7e0bcb0760f7b9652ba083 (diff) | |
environment: Add '--root' option.
* guix/scripts/environment.scm (show-help, %options): Add --root.
(register-gc-root): New procedure.
(guix-environment): Call 'register-gc-root' when OPTS has a 'gc-root'
option.
* doc/guix.texi (Invoking guix environment): Document it.
* tests/guix-environment.sh: Add tests.
Diffstat (limited to 'tests/guix-environment.sh')
| -rw-r--r-- | tests/guix-environment.sh | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/guix-environment.sh b/tests/guix-environment.sh index 68343520b07..2b3bbfe036f 100644 --- a/tests/guix-environment.sh +++ b/tests/guix-environment.sh | |||
| @@ -25,7 +25,8 @@ set -e | |||
| 25 | guix environment --version | 25 | guix environment --version |
| 26 | 26 | ||
| 27 | tmpdir="t-guix-environment-$$" | 27 | tmpdir="t-guix-environment-$$" |
| 28 | trap 'rm -r "$tmpdir"' EXIT | 28 | gcroot="t-guix-environment-gc-root-$$" |
| 29 | trap 'rm -r "$tmpdir"; rm -f "$gcroot"' EXIT | ||
| 29 | 30 | ||
| 30 | mkdir "$tmpdir" | 31 | mkdir "$tmpdir" |
| 31 | 32 | ||
| @@ -61,6 +62,20 @@ fi | |||
| 61 | guix environment --bootstrap --ad-hoc guile-bootstrap --pure \ | 62 | guix environment --bootstrap --ad-hoc guile-bootstrap --pure \ |
| 62 | -- "$SHELL" -c 'test -f "$GUIX_ENVIRONMENT/bin/guile"' | 63 | -- "$SHELL" -c 'test -f "$GUIX_ENVIRONMENT/bin/guile"' |
| 63 | 64 | ||
| 65 | # Make sure '-r' works as expected. | ||
| 66 | rm -f "$gcroot" | ||
| 67 | expected="`guix environment --bootstrap --ad-hoc guile-bootstrap \ | ||
| 68 | -- "$SHELL" -c 'echo $GUIX_ENVIRONMENT'`" | ||
| 69 | guix environment --bootstrap -r "$gcroot" --ad-hoc guile-bootstrap \ | ||
| 70 | -- guile -c 1 | ||
| 71 | test `readlink "$gcroot"` = "$expected" | ||
| 72 | |||
| 73 | # Make sure '-r' is idempotent. | ||
| 74 | guix environment --bootstrap -r "$gcroot" --ad-hoc guile-bootstrap \ | ||
| 75 | -- guile -c 1 | ||
| 76 | test `readlink "$gcroot"` = "$expected" | ||
| 77 | |||
| 78 | |||
| 64 | case "`uname -m`" in | 79 | case "`uname -m`" in |
| 65 | x86_64) | 80 | x86_64) |
| 66 | # On x86_64, we should be able to create a 32-bit environment. | 81 | # On x86_64, we should be able to create a 32-bit environment. |
