[PATCH 2/4] [cmd] Prevent external env vars causing tests to fail

Frédéric Delanoy frederic.delanoy at gmail.com
Mon Nov 19 16:24:57 CST 2012


On Mon, Nov 19, 2012 at 10:03 PM, Ann and Jason Edmeades
<jason at edmeades.me.uk> wrote:
> Existance of external environment variables should not cause
> make test to fail, but it can cause extra lines in some of the
> set commands if the test does not first clear them out.
>
> [Fixes bug 32087]

> diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
> index a1a3c4a..3efcd2a 100644
> --- a/programs/cmd/tests/test_builtins.cmd
> +++ b/programs/cmd/tests/test_builtins.cmd
> @@ -239,6 +239,9 @@ set FOO=
>
> echo ------------ Testing 'set' ------------
> call :setError 0
> +rem Remove any FOO* BA* environment variables from shell before proceeding
> +for /f "delims==" %%i in ('set ba') do set %%i=
> +for /f "delims==" %%i in ('set foo') do set %%i=
> set FOOBAR 2> nul > nul
> echo %ErrorLevel%
> set FOOBAR =  baz

IMHO it might be better to use variable names like WINE_xxx for tests
involving "enumerations" to avoid needlessly altering the environment.
(not that BAR, FOO or FOOBAR are likely to be already used environment
variables)

Frédéric



More information about the wine-devel mailing list