From: "Darrick J. Wong" <djwong@kernel.org>
To: djwong@kernel.org, guaneryu@gmail.com
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me
Subject: [PATCH 1/1] new: allow users to specify a new test id
Date: Tue, 06 Jul 2021 17:21:04 -0700 [thread overview]
Message-ID: <162561726493.543346.17291318180978776290.stgit@locust> (raw)
In-Reply-To: <162561725931.543346.16210906692072836195.stgit@locust>
From: Darrick J. Wong <djwong@kernel.org>
Alter the ./new script so that one can set the test id explicitly.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
new | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/new b/new
index 07144399..51111f08 100755
--- a/new
+++ b/new
@@ -26,7 +26,18 @@ usage()
}
[ $# -eq 0 ] && usage
-tdir=tests/$1
+
+if echo "$1" | grep -q '/'; then
+ if [ -e "tests/$1" ]; then
+ echo "$1: test already exists."
+ exit 1
+ fi
+ tdir="tests/$(echo "$1" | cut -d '/' -f 1)"
+ id="$(echo "$1" | cut -d '/' -f 2)"
+else
+ tdir=tests/$1
+ id="$(basename "$(./tools/nextid "$1")")"
+fi
i=0
line=0
@@ -36,7 +47,6 @@ eof=1
export AWK_PROG="$(type -P awk)"
[ "$AWK_PROG" = "" ] && { echo "awk not found"; exit; }
-id="$(basename "$(./tools/nextid "$1")")"
echo "Next test id is $id"
shift
next prev parent reply other threads:[~2021-07-07 0:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-07 0:20 [PATCHSET 0/1] fstests: fixes for test control code Darrick J. Wong
2021-07-07 0:21 ` Darrick J. Wong [this message]
2021-07-18 13:57 ` [PATCH 1/1] new: allow users to specify a new test id Eryu Guan
2021-07-18 16:23 ` Darrick J. Wong
-- strict thread matches above, loose matches on Subject: below --
2021-07-20 1:08 [PATCHSET v2 0/1] fstests: fixes for test control code Darrick J. Wong
2021-07-20 1:08 ` [PATCH 1/1] new: allow users to specify a new test id Darrick J. Wong
2021-07-22 6:35 ` Christoph Hellwig
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=162561726493.543346.17291318180978776290.stgit@locust \
--to=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=guan@eryu.me \
--cc=guaneryu@gmail.com \
--cc=linux-xfs@vger.kernel.org \
/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