[LTP] [RFC PATCH 1/2] lib/tst_test.sh: TST_TESTFUNC_DATA and TST_TESTFUNC_DATA_IFS

Petr Vorel pvorel@suse.cz
Wed May 16 16:01:46 CEST 2018


Hi Cyril,


> And know tst_i (sequence number of a test) for test is needed for some tests which use
> only one function - i.e. TST_TESTFUNC_DATA is passed (no TST_CNT). Let's keep $1 as
> sequence number and $2 for data itself.
> I wonder if $1 shouldn't always have tst_i, even for tests without $TST_CNT. Something
> like:
> +++ testcases/lib/tst_test.sh
> @@ -352,14 +352,14 @@ tst_run()
>  			if type test1 > /dev/null 2>&1; then
>  				for tst_i in $(seq $TST_CNT); do
>  					local res=$(tst_resstr)
> -					$TST_TESTFUNC$tst_i
> +					$TST_TESTFUNC$tst_i $tst_i $TST_TEST_DATA
>  					tst_rescmp "$res"
>  					TST_COUNT=$((TST_COUNT+1))
>  				done
>  			else
>  				for tst_i in $(seq $TST_CNT); do
>  					local res=$(tst_resstr)
> -					$TST_TESTFUNC $tst_i
> +					$TST_TESTFUNC $tst_i $TST_TEST_DATA
>  					tst_rescmp "$res"
>  					TST_COUNT=$((TST_COUNT+1))
>  				done
> @@ -378,7 +378,7 @@ tst_run()
>  			done
>  		else
>  			local res=$(tst_resstr)
> -			$TST_TESTFUNC
> +			$TST_TESTFUNC 1
Actually, I'd avoid this '1', not useful much.
>  			tst_rescmp "$res"
>  			TST_COUNT=$((TST_COUNT+1))
>  		fi


Kind regards,
Petr


More information about the ltp mailing list