FS/XFS testing framework
 help / color / mirror / Atom feed
From: David Disseldorp <ddiss@suse.de>
To: fstests@vger.kernel.org, tytso@mit.edu
Cc: djwong@kernel.org, zlang@redhat.com, David Disseldorp <ddiss@suse.de>
Subject: [PATCH v4 3/5] check: make a few variables local
Date: Fri,  8 Jul 2022 10:51:40 +0200	[thread overview]
Message-ID: <20220708085142.20991-4-ddiss@suse.de> (raw)
In-Reply-To: <20220708085142.20991-1-ddiss@suse.de>

The variables aren't used outside of function scope. Also convert one
timestamp output to use the helper.

Signed-off-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
---
 check | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/check b/check
index dbad6dde..08857f7e 100755
--- a/check
+++ b/check
@@ -179,10 +179,10 @@ get_all_tests()
 # the function from that list.
 trim_test_list()
 {
-	test_list="$*"
+	local test_list="$*"
 
 	rm -f $tmp.grep
-	numsed=0
+	local numsed=0
 	for t in $test_list
 	do
 	    if [ $numsed -gt 100 ]; then
@@ -207,7 +207,7 @@ _wallclock()
 
 _timestamp()
 {
-    now=`date "+%T"`
+    local now=`date "+%T"`
     echo -n " [$now]"
 }
 
@@ -603,7 +603,7 @@ fi
 
 function run_section()
 {
-	local section=$1
+	local section=$1 skip
 
 	OLD_FSTYP=$FSTYP
 	OLD_TEST_FS_MOUNT_OPTS=$TEST_FS_MOUNT_OPTS
@@ -820,7 +820,7 @@ function run_section()
 		rm -f core $seqres.notrun
 
 		start=`_wallclock`
-		$timestamp && echo -n "	["`date "+%T"`"]"
+		$timestamp && _timestamp
 		[ ! -x $seq ] && chmod u+x $seq # ensure we can run it
 		$LOGGER_PROG "run xfstest $seqnum"
 		if [ -w /dev/kmsg ]; then
-- 
2.35.3


  parent reply	other threads:[~2022-07-08  8:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-08  8:51 [PATCH v4 0/5] check: add option to rerun failed tests David Disseldorp
2022-07-08  8:51 ` [PATCH v4 1/5] report: use array for REPORT_ENV_LIST David Disseldorp
2022-07-08  8:51 ` [PATCH v4 2/5] report: pass through most details as function parameters David Disseldorp
2022-07-08  8:51 ` David Disseldorp [this message]
2022-07-08  8:51 ` [PATCH v4 4/5] check: append bad / notrun arrays in helper function David Disseldorp
2022-07-08  8:51 ` [PATCH v4 5/5] check: add -L <n> parameter to rerun failed tests David Disseldorp
2022-07-08 15:21   ` Darrick J. Wong
2022-07-08 16:36 ` [PATCH v4 0/5] check: add option " Zorro Lang

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=20220708085142.20991-4-ddiss@suse.de \
    --to=ddiss@suse.de \
    --cc=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=zlang@redhat.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