linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eryu Guan <guan@eryu.me>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: guaneryu@gmail.com, linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH 1/1] new: allow users to specify a new test id
Date: Sun, 18 Jul 2021 21:57:14 +0800	[thread overview]
Message-ID: <YPQzOiqnugT4MeNq@desktop> (raw)
In-Reply-To: <162561726493.543346.17291318180978776290.stgit@locust>

On Tue, Jul 06, 2021 at 05:21:04PM -0700, Darrick J. Wong wrote:
> 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>

Looks good to me. Mind updating the usage info as well?

Thanks,
Eryu

> ---
>  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
>  

  reply	other threads:[~2021-07-18 13:57 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 ` [PATCH 1/1] new: allow users to specify a new test id Darrick J. Wong
2021-07-18 13:57   ` Eryu Guan [this message]
2021-07-18 16:23     ` Darrick J. Wong
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=YPQzOiqnugT4MeNq@desktop \
    --to=guan@eryu.me \
    --cc=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).