From 64c0f180c51c3dc940348dc82fbec87d37ed628b Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 2 Jul 2015 17:07:17 -0700 Subject: [PATCH] tests: avoid false failure of factor-parallel.sh with SHELL=zsh With SHELL=/bin/zsh and a PATH-modifying ~/.zshenv, the factor-parallel.sh test would fail when the factor program found via the ~/.zshenv-set PATH did not have the latest buffering fix ("factor: ensure atomic output through pipes", commit v8.23-242-gf2db30e). That happened to me because my .zshenv set PATH so that the prior version of factor was used, due to the effective invocation of "$SHELL -c factor" via the test's "...|split -nr/4 --filter=factor|..." invocation. * tests/envvar-check: If the offending usage of $SHELL -c modifies PATH, undefine that variable. --- tests/envvar-check | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/envvar-check b/tests/envvar-check index 76becbf..9c28693 100644 --- a/tests/envvar-check +++ b/tests/envvar-check @@ -48,6 +48,12 @@ vars=' TMPDIR VERSION_CONTROL ' + +# If invoking $SHELL -c 'CODE' puts a modified PATH in the environment, +# as zsh does when ~/.zshenv modifies PATH, also unset SHELL. +( PATH=$PATH:/no-such; $SHELL -c 'test '"$PATH"' = "$PATH"') \ + || vars="$vars SHELL" + for var in $vars do $as_unset $var -- 2.3.7