fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: guaneryu@gmail.com, linux-xfs@vger.kernel.org,
	fstests@vger.kernel.org, guan@eryu.me
Subject: Re: [PATCH 5/5] new: only allow documented test group names
Date: Thu, 2 Sep 2021 07:29:26 +1000	[thread overview]
Message-ID: <20210901212926.GB1756565@dread.disaster.area> (raw)
In-Reply-To: <163045517721.771564.12357505876401888990.stgit@magnolia>

On Tue, Aug 31, 2021 at 05:12:57PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Now that we require all group names to be listed in doc/group-names.txt,
> we can use that (instead of running mkgroupfile) to check if the group
> name(s) supplied by the user actually exist.  This has the secondary
> effect of being a second nudge towards keeping the description of groups
> up to date.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
>  new |   24 +++++++++++-------------
>  1 file changed, 11 insertions(+), 13 deletions(-)
> 
> 
> diff --git a/new b/new
> index 2097a883..44777bd6 100755
> --- a/new
> +++ b/new
> @@ -83,6 +83,14 @@ then
>      exit 1
>  fi
>  
> +# Extract group names from the documentation.
> +group_names() {
> +	grep '^[[:lower:][:digit:]_]' doc/group-names.txt | awk '
> +{if ($1 != "" && $1 != "Group" && $2 != "Name:" && $1 != "all")
> +	printf("%s\n", $1);
> +}'
> +}

Took me a while to realise this was running an awk script for output
slection but using grep for regex based line selection. Awk can do
both of these things just fine, and the result is much more
readable:

group_names() {
	awk '/^[[:lower:][:digit:]_]/ {
		if ($1 != "Group" && $2 != "Name:" && $1 != "all")
			printf("%s\n", $1);
	}' doc/group-names.txt
}


$ awk '/^[[:lower:][:digit:]_]/ { if ($1 != "Group" && $2 != "Name:" && $1 != "all") printf("%s\n", $1); }' t.t
auto
quick
deprecated
acl
admin
aio
atime
....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

      parent reply	other threads:[~2021-09-01 21:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01  0:12 [PATCHSET 0/5] fstests: document all test groups Darrick J. Wong
2021-09-01  0:12 ` [PATCH 1/5] ceph: re-tag copy_file_range as being in the copy_range group Darrick J. Wong
2021-09-01  8:44   ` Christoph Hellwig
2021-09-01  0:12 ` [PATCH 2/5] xfs: move reflink tests into the clone group Darrick J. Wong
2021-09-01  8:46   ` Christoph Hellwig
2021-09-01  0:12 ` [PATCH 3/5] xfs: fix incorrect fuzz test group name Darrick J. Wong
2021-09-01  8:48   ` Christoph Hellwig
2021-09-01  0:12 ` [PATCH 4/5] tools: make sure that test groups are described in the documentation Darrick J. Wong
2021-09-01  4:46   ` Amir Goldstein
2021-09-01 16:43     ` Darrick J. Wong
2021-09-02  4:49       ` Amir Goldstein
2021-09-02 15:03         ` Darrick J. Wong
2021-09-01  8:50   ` Christoph Hellwig
2021-09-01  0:12 ` [PATCH 5/5] new: only allow documented test group names Darrick J. Wong
2021-09-01  8:53   ` Christoph Hellwig
2021-09-01 21:29   ` Dave Chinner [this message]

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=20210901212926.GB1756565@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=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;
as well as URLs for NNTP newsgroup(s).