From: Ruediger Meier Date: Sat, 10 May 2014 05:04:11 +0000 (+0200) Subject: tests: fix var names X-Git-Tag: v2.25-rc1~191^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c08863ff72554b5449a371d1808e4e8fc1bb61de;p=thirdparty%2Futil-linux.git tests: fix var names Translate "." and "-" to "_". We assume that nobody will add completely stupid test file names. Signed-off-by: Ruediger Meier --- diff --git a/tests/functions.sh b/tests/functions.sh index 0366f163b5..6631de49d8 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -100,8 +100,11 @@ function ts_has_option { # user may set options by env for a single test or whole component # e.g. TS_OPT_ipcs_limits2_fake="yes" or TS_OPT_ipcs_fake="yes" - eval local env_opt_test=\$TS_OPT_${TS_COMPONENT}_${TS_TESTNAME}_${NAME} - eval local env_opt_comp=\$TS_OPT_${TS_COMPONENT}_${NAME} + local v_test=${TS_TESTNAME//[-.]/_} + local v_comp=${TS_COMPONENT//[-.]/_} + local v_name=${NAME//[-.]/_} + eval local env_opt_test=\$TS_OPT_${v_comp}_${v_test}_${v_name} + eval local env_opt_comp=\$TS_OPT_${v_comp}_${v_name} if [ "$env_opt_test" = "yes" \ -o "$env_opt_comp" = "yes" -a "$env_opt_test" != "no" ]; then echo "yes"