linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH blktests] Restore support for running tests without prior test results
@ 2020-05-20 16:52 Bart Van Assche
  2020-06-09 14:08 ` Bart Van Assche
  2020-06-10 21:26 ` Chaitanya Kulkarni
  0 siblings, 2 replies; 4+ messages in thread
From: Bart Van Assche @ 2020-05-20 16:52 UTC (permalink / raw)
  To: Omar Sandoval; +Cc: linux-block, Bart Van Assche

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@acm.org>
---
 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
 	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"]}

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH blktests] Restore support for running tests without prior test results
  2020-05-20 16:52 [PATCH blktests] Restore support for running tests without prior test results Bart Van Assche
@ 2020-06-09 14:08 ` Bart Van Assche
  2020-06-15 23:01   ` Omar Sandoval
  2020-06-10 21:26 ` Chaitanya Kulkarni
  1 sibling, 1 reply; 4+ messages in thread
From: Bart Van Assche @ 2020-06-09 14:08 UTC (permalink / raw)
  To: Omar Sandoval; +Cc: linux-block

On 2020-05-20 09:52, 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@acm.org>
> ---
>  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
>  	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"]}
> 

Omar, ping?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH blktests] Restore support for running tests without prior test results
  2020-05-20 16:52 [PATCH blktests] Restore support for running tests without prior test results Bart Van Assche
  2020-06-09 14:08 ` Bart Van Assche
@ 2020-06-10 21:26 ` Chaitanya Kulkarni
  1 sibling, 0 replies; 4+ messages in thread
From: Chaitanya Kulkarni @ 2020-06-10 21:26 UTC (permalink / raw)
  To: Bart Van Assche, Omar Sandoval; +Cc: linux-block@vger.kernel.org

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@acm.org>
> ---
>   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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH blktests] Restore support for running tests without prior test results
  2020-06-09 14:08 ` Bart Van Assche
@ 2020-06-15 23:01   ` Omar Sandoval
  0 siblings, 0 replies; 4+ messages in thread
From: Omar Sandoval @ 2020-06-15 23:01 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: Omar Sandoval, linux-block

On Tue, Jun 09, 2020 at 07:08:45AM -0700, Bart Van Assche wrote:
> On 2020-05-20 09:52, 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@acm.org>
> > ---
> >  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
> >  	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"]}
> > 
> 
> Omar, ping?

Sorry Bart, I had a family emergency so I've been away for a few weeks.
This fix didn't work for me for the same reason that Li Zhijian reported
in https://github.com/osandov/blktests/pull/64. For now I'm going to
apply that fix instead. If you'd like blktests to work with set -u,
please do so by adding it to the main check script and modifying the
rest of the framework.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-15 23:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-20 16:52 [PATCH blktests] Restore support for running tests without prior test results Bart Van Assche
2020-06-09 14:08 ` Bart Van Assche
2020-06-15 23:01   ` Omar Sandoval
2020-06-10 21:26 ` Chaitanya Kulkarni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).