mirror of
https://https.git.savannah.gnu.org/git/guix.git/
synced 2025-07-10 16:50:43 +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:
parent
0848615300
commit
22f95e028f
3 changed files with 30 additions and 26 deletions
|
@ -1,5 +1,5 @@
|
|||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2015, 2019 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
|
@ -25,19 +25,6 @@
|
|||
|
||||
;; Test the (guix scripts) module.
|
||||
|
||||
(define-syntax-rule (with-environment-variable variable value body ...)
|
||||
"Run BODY with VARIABLE set to VALUE."
|
||||
(let ((orig (getenv variable)))
|
||||
(dynamic-wind
|
||||
(lambda ()
|
||||
(setenv variable value))
|
||||
(lambda ()
|
||||
body ...)
|
||||
(lambda ()
|
||||
(if orig
|
||||
(setenv variable orig)
|
||||
(unsetenv variable))))))
|
||||
|
||||
|
||||
(test-begin "scripts")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue