1
Fork 0
mirror of https://https.git.savannah.gnu.org/git/guix.git/ synced 2025-07-10 08:30:39 +02:00

tests: Add 'with-environment-variable'.

* tests/scripts.scm (with-environment-variable): Move to...
* guix/tests.scm (with-environment-variable): ... here.
* tests/build-utils.scm ("wrap-program, one input, multiple calls"):
Use it instead of 'setenv'.
This commit is contained in:
Ludovic Courtès 2019-03-16 15:11:29 +01:00
parent 0848615300
commit 22f95e028f
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
3 changed files with 30 additions and 26 deletions

View file

@ -107,19 +107,21 @@
;; it can't know about the bootstrap bash in the store, since it's not
;; named "bash". Help it out a bit by providing a symlink it this
;; package's output.
(setenv "PATH" (dirname bash))
(wrap-program foo `("GUIX_FOO" prefix ("hello")))
(wrap-program foo `("GUIX_BAR" prefix ("world")))
(with-environment-variable "PATH" (dirname bash)
(wrap-program foo `("GUIX_FOO" prefix ("hello")))
(wrap-program foo `("GUIX_BAR" prefix ("world")))
;; The bootstrap Bash is linked against an old libc and would abort with
;; an assertion failure when trying to load incompatible locale data.
(unsetenv "LOCPATH")
;; The bootstrap Bash is linked against an old libc and would abort
;; with an assertion failure when trying to load incompatible locale
;; data.
(unsetenv "LOCPATH")
(let* ((pipe (open-input-pipe foo))
(str (get-string-all pipe)))
(with-directory-excursion directory
(for-each delete-file '("foo" ".foo-real")))
(and (zero? (close-pipe pipe))
str)))))))
(let* ((pipe (open-input-pipe foo))
(str (get-string-all pipe)))
(with-directory-excursion directory
(for-each delete-file '("foo" ".foo-real")))
(and (zero? (close-pipe pipe))
str))))))
(test-end)