test-lib.sh: unset some more TODOTXT env vars for extra safety

While preparing a setup where env vars overload config file,
I had the bad experience that my actual todo.txt was messed up
by the testsuite so it's safer to unset everything.

Even so, some tests could have failed if some TODOTXT_ were set
in the user environment, for example:
export TODOTXT_PLAIN=1
./t1200-pri.sh

Since test-lib.sh does not depend on bash currently, calculate
the list of variables to be unset using set|sed.

Signed-off-by: Emil Sit <sit@emilsit.net>
This commit is contained in:
Philippe Teuwen
2009-04-20 10:20:40 +02:00
committed by Emil Sit
parent 2e62536f90
commit 701c30c04f

View File

@@ -37,7 +37,9 @@ VISUAL=:
unset CDPATH
# Protect ourselves from using predefined TODOTXT_CFG_FILE
unset TODOTXT_CFG_FILE
unset TODOTXT_CFG_FILE $(set|sed '/^TODOTXT_/!d;s/=.*//')
# To prevent any damage if someone has still those exported somehow in his env:
unset TODO_FILE DONE_FILE REPORT_FILE TMP_FILE
# Each test should start with something like this, after copyright notices:
#