linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Omar Sandoval <osandov@fb.com>
Cc: linux-block@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>
Subject: [PATCH blktests] Restore support for running tests without prior test results
Date: Wed, 20 May 2020 09:52:41 -0700	[thread overview]
Message-ID: <20200520165241.24798-1-bvanassche@acm.org> (raw)

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"]}

             reply	other threads:[~2020-05-20 16:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-20 16:52 Bart Van Assche [this message]
2020-06-09 14:08 ` [PATCH blktests] Restore support for running tests without prior test results Bart Van Assche
2020-06-15 23:01   ` Omar Sandoval
2020-06-10 21:26 ` Chaitanya Kulkarni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200520165241.24798-1-bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=linux-block@vger.kernel.org \
    --cc=osandov@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).