mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-05-27 19:41:50 +02:00
tests: Avoid unnecessary use of 'mock'.
* tests/build-utils.scm ("wrap-script, simple case"): Use the real
'which' instead of mocking it.
This commit is contained in:
@@ -151,11 +151,12 @@ echo hello world"))
|
|||||||
(test-equal "wrap-script, simple case"
|
(test-equal "wrap-script, simple case"
|
||||||
(string-append
|
(string-append
|
||||||
(format #f "\
|
(format #f "\
|
||||||
#!GUILE --no-auto-compile
|
#!~a --no-auto-compile
|
||||||
#!#; Guix wrapper
|
#!#; Guix wrapper
|
||||||
#\\-~s
|
#\\-~s
|
||||||
#\\-~s
|
#\\-~s
|
||||||
"
|
"
|
||||||
|
(which "guile")
|
||||||
'(begin (let ((current (getenv "GUIX_FOO")))
|
'(begin (let ((current (getenv "GUIX_FOO")))
|
||||||
(setenv "GUIX_FOO"
|
(setenv "GUIX_FOO"
|
||||||
(if current
|
(if current
|
||||||
@@ -175,11 +176,9 @@ echo hello world"))
|
|||||||
(lambda (port)
|
(lambda (port)
|
||||||
(format port script-contents)))
|
(format port script-contents)))
|
||||||
(chmod script-file-name #o777)
|
(chmod script-file-name #o777)
|
||||||
|
(wrap-script script-file-name
|
||||||
(mock ((guix build utils) which (const "GUILE"))
|
`("GUIX_FOO" prefix ("/some/path"
|
||||||
(wrap-script script-file-name
|
"/some/other/path")))
|
||||||
`("GUIX_FOO" prefix ("/some/path"
|
|
||||||
"/some/other/path"))))
|
|
||||||
(let ((str (call-with-input-file script-file-name get-string-all)))
|
(let ((str (call-with-input-file script-file-name get-string-all)))
|
||||||
(with-directory-excursion directory
|
(with-directory-excursion directory
|
||||||
(delete-file "foo"))
|
(delete-file "foo"))
|
||||||
|
|||||||
Reference in New Issue
Block a user