From d9a9ff09b80b4dcbdd266c7a7830d61491da674a Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Sat, 10 May 2014 04:51:22 +0200 Subject: tests: call ts_init_env as early as possible Soon we want to use some env vars within ts_has_option(). That's why we move some lines to make this possible. Signed-off-by: Ruediger Meier --- tests/functions.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'tests/functions.sh') diff --git a/tests/functions.sh b/tests/functions.sh index 191a310ac..e76408baf 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -132,6 +132,7 @@ function ts_init_core_subtest_env { function ts_init_env { local mydir=$(ts_abspath ${0%/*}) + local tmp LANG="POSIX" LANGUAGE="POSIX" @@ -178,6 +179,11 @@ function ts_init_env { TS_VERBOSE=$(ts_has_option "verbose" "$*") TS_PARALLEL=$(ts_has_option "parallel" "$*") + tmp=$( ts_has_option "memcheck" "$*") + if [ "$tmp" == "yes" -a -f /usr/bin/valgrind ]; then + TS_VALGRIND_CMD="/usr/bin/valgrind" + fi + BLKID_FILE="$TS_OUTDIR/${TS_TESTNAME}.blkidtab" declare -a TS_SUID_PROGS @@ -233,15 +239,10 @@ function ts_init_subtest { } function ts_init { + ts_init_env "$*" + local is_fake=$( ts_has_option "fake" "$*") local is_force=$( ts_has_option "force" "$*") - local is_memcheck=$( ts_has_option "memcheck" "$*") - - if [ "$is_memcheck" == "yes" -a -f /usr/bin/valgrind ]; then - TS_VALGRIND_CMD="/usr/bin/valgrind" - fi - - ts_init_env "$*" if [ "$TS_PARALLEL" == "yes" ]; then TS_TITLE=$(printf "%13s: %-30s ..." "$TS_COMPONENT" "$TS_DESC") -- cgit v1.2.3-55-g7522