From 22f95e028f038cee342f455dfc55bd32b804907c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 16 Mar 2019 15:11:29 +0100 Subject: 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'. --- tests/scripts.scm | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'tests/scripts.scm') diff --git a/tests/scripts.scm b/tests/scripts.scm index 3901710953..efee271197 100644 --- a/tests/scripts.scm +++ b/tests/scripts.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015 Ludovic Courtès +;;; Copyright © 2015, 2019 Ludovic Courtès ;;; ;;; 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") -- cgit v1.2.3