summaryrefslogtreecommitdiffstats
path: root/tests/functions.sh
diff options
context:
space:
mode:
authorRuediger Meier2014-05-10 04:51:22 +0200
committerRuediger Meier2014-05-10 04:59:34 +0200
commitd9a9ff09b80b4dcbdd266c7a7830d61491da674a (patch)
treed34c9cddd71bd74464378b54dd61f0440f0e3608 /tests/functions.sh
parentlibsmartcols: (docs) reorder functions in version section (diff)
downloadkernel-qcow2-util-linux-d9a9ff09b80b4dcbdd266c7a7830d61491da674a.tar.gz
kernel-qcow2-util-linux-d9a9ff09b80b4dcbdd266c7a7830d61491da674a.tar.xz
kernel-qcow2-util-linux-d9a9ff09b80b4dcbdd266c7a7830d61491da674a.zip
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 <ruediger.meier@ga-group.nl>
Diffstat (limited to 'tests/functions.sh')
-rw-r--r--tests/functions.sh15
1 files changed, 8 insertions, 7 deletions
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")