From c08863ff72554b5449a371d1808e4e8fc1bb61de Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Sat, 10 May 2014 07:04:11 +0200 Subject: tests: fix var names Translate "." and "-" to "_". We assume that nobody will add completely stupid test file names. Signed-off-by: Ruediger Meier --- tests/functions.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests/functions.sh') diff --git a/tests/functions.sh b/tests/functions.sh index 0366f163b..6631de49d 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" -- cgit v1.2.3-55-g7522