aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTaylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>2015-05-06 20:13:31 +0200
committerTaylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>2015-05-06 22:34:54 +0200
commit9e006fb3de0bd1af2434b32c3be23101e00b1b10 (patch)
treec2e73c3ce0c5f68f329ab620fcc7e29a3e7f30ed /tests
parent56203284b626cfefac355ecc10ec23191d80eabd (diff)
downloadpatches-9e006fb3de0bd1af2434b32c3be23101e00b1b10.tar
patches-9e006fb3de0bd1af2434b32c3be23101e00b1b10.tar.gz
tests: Fix etc/profile test.
* tests/profiles.scm ("etc/profile"): Unset GUIX_PROFILE before sourcing etc/profile. Use '.' instead of 'source' for sourcing. Call 'echo $PATH' instead of using the output of 'set' to determine whether PATH is set.
Diffstat (limited to 'tests')
-rw-r--r--tests/profiles.scm14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/profiles.scm b/tests/profiles.scm
index a39717191d..de1411dca2 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -237,14 +237,16 @@
(mbegin %store-monad
(built-derivations (list drv))
(let* ((pipe (open-input-pipe
- (string-append "source "
- profile "/etc/profile; "
- "unset GUIX_PROFILE; set")))
- (env (get-string-all pipe)))
+ (string-append "unset GUIX_PROFILE; "
+ ;; 'source' is a Bashism; use '.' (dot).
+ ". " profile "/etc/profile; "
+ ;; Don't try to parse set(1) output because
+ ;; it differs among shells; just use echo.
+ "echo $PATH")))
+ (path (get-string-all pipe)))
(return
(and (zero? (close-pipe pipe))
- (string-contains env
- (string-append "PATH=" profile "/bin"))))))))
+ (string-contains path (string-append profile "/bin"))))))))
(test-end "profiles")