aboutsummaryrefslogtreecommitdiff
path: root/tests/build-utils.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/build-utils.scm')
-rw-r--r--tests/build-utils.scm25
1 files changed, 11 insertions, 14 deletions
diff --git a/tests/build-utils.scm b/tests/build-utils.scm
index 61e6c44e63..47a57a984b 100644
--- a/tests/build-utils.scm
+++ b/tests/build-utils.scm
@@ -151,11 +151,12 @@ echo hello world"))
(test-equal "wrap-script, simple case"
(string-append
(format #f "\
-#!GUILE --no-auto-compile
+#!~a --no-auto-compile
#!#; Guix wrapper
#\\-~s
#\\-~s
"
+ (which "guile")
'(begin (let ((current (getenv "GUIX_FOO")))
(setenv "GUIX_FOO"
(if current
@@ -175,11 +176,9 @@ echo hello world"))
(lambda (port)
(format port script-contents)))
(chmod script-file-name #o777)
-
- (mock ((guix build utils) which (const "GUILE"))
- (wrap-script script-file-name
- `("GUIX_FOO" prefix ("/some/path"
- "/some/other/path"))))
+ (wrap-script script-file-name
+ `("GUIX_FOO" prefix ("/some/path"
+ "/some/other/path")))
(let ((str (call-with-input-file script-file-name get-string-all)))
(with-directory-excursion directory
(delete-file "foo"))
@@ -235,13 +234,11 @@ print('hello world')"))
(lambda (port)
(format port "This is not a script")))
(chmod script-file-name #o777)
- (catch 'srfi-34
- (lambda ()
- (wrap-script script-file-name
- #:guile "MYGUILE"
- `("GUIX_FOO" prefix ("/some/path"
- "/some/other/path"))))
- (lambda (type obj)
- (wrap-error? obj)))))))
+ (guard (c ((wrap-error? c) #t))
+ (wrap-script script-file-name
+ #:guile "MYGUILE"
+ `("GUIX_FOO" prefix ("/some/path"
+ "/some/other/path")))
+ #f)))))
(test-end)