Re: [PATCH blktests] Restore support for running tests without prior test results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/20/20 9:52 AM, Bart Van Assche wrote:
> This patch fixes the following runtime error:
> 
> ./check: line 245: LAST_TEST_RUN: unbound variable
> 
> Fixes: 203b5723a28e ("Show last run for skipped tests")
> Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
> ---
>   check | 8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/check b/check
> index 0a4e539a5cd9..5151d01995ac 100755
> --- a/check
> +++ b/check
> @@ -240,9 +240,15 @@ _output_last_test_run() {
>   }
>   
>   _output_test_run() {
> +	local param_count
Is there any particular reason why new line is not added after variable 
declaration ? (I see that check file is not strict about that, which it 
should be to start with).
>   	if [[ -t 1 ]]; then
>   		# Move the cursor back up to the status.
> -		tput cuu $((${#LAST_TEST_RUN[@]} + 1))
> +		if [ -n "${LAST_TEST_RUN+set}" ]; then
> +			param_count=${#LAST_TEST_RUN[@]}
> +		else
> +			param_count=0 > +		fi
> +		tput cuu $((param_count + 1))
>   	fi
>   
>   	local status=${TEST_RUN["status"]}
> 
Overall patch looks good, I've tested it with nvme group which works fine.




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux