fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: djwong@kernel.org, guaneryu@gmail.com
Cc: Christoph Hellwig <hch@lst.de>,
	Amir Goldstein <amir73il@gmail.com>,
	linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me
Subject: [PATCH 8/8] new: only allow documented test group names
Date: Thu, 16 Sep 2021 17:39:46 -0700	[thread overview]
Message-ID: <163183918676.952957.10906553908004142603.stgit@magnolia> (raw)
In-Reply-To: <163183914290.952957.11558799225344566504.stgit@magnolia>

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
---
 new |   24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)


diff --git a/new b/new
index 2097a883..6b7dc5d4 100755
--- a/new
+++ b/new
@@ -83,6 +83,14 @@ then
     exit 1
 fi
 
+# Extract group names from the documentation.
+group_names() {
+	awk '/^[[:lower:][:digit:]_]/ {
+		if ($1 != "" && $1 != "Group" && $2 != "Name:" && $1 != "all")
+			printf("%s\n", $1);
+	}' doc/group-names.txt
+}
+
 if [ $# -eq 0 ]
 then
 
@@ -93,16 +101,7 @@ then
 	[ -z "$ans" ] && ans=other
 	if [ "X$ans" = "X?" ]
 	then
-	    for d in $SRC_GROUPS; do
-		(cd "tests/$d/" ; ../../tools/mkgroupfile "$tmpfile")
-		l=$(sed -n < "$tmpfile" \
-		    -e 's/#.*//' \
-		    -e 's/$/ /' \
-		    -e 's;\(^[0-9][0-9][0-9]\)\(.*$\);\2;p')
-		grpl="$grpl $l"
-	    done
-	    lst=`for word in $grpl; do echo $word; done | sort| uniq `
-	    echo $lst
+	    echo $(group_names)
 	else
 	    # only allow lower cases, spaces, digits and underscore in group
 	    inval=`echo $ans | tr -d '[:lower:][:space:][:digit:]_'`
@@ -120,11 +119,10 @@ then
 else
     # expert mode, groups are on the command line
     #
-    (cd "$tdir" ; ../../tools/mkgroupfile "$tmpfile")
     for g in $*
     do
-	if ! grep -q "[[:space:]]$g" "$tmpfile"; then
-	    echo "Warning: group \"$g\" not defined in $tdir tests"
+	if ! grep -q "^$g" doc/group-names.txt; then
+	    echo "Warning: group \"$g\" not defined in documentation"
 	fi
     done
     ans="$*"


  parent reply	other threads:[~2021-09-17  0:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17  0:39 [PATCHSET v4 0/8] fstests: document all test groups Darrick J. Wong
2021-09-17  0:39 ` [PATCH 1/8] ceph: re-tag copy_file_range as being in the copy_range group Darrick J. Wong
2021-09-17  0:39 ` [PATCH 2/8] xfs: move reflink tests into the clone group Darrick J. Wong
2021-09-17  0:39 ` [PATCH 3/8] xfs: fix incorrect fuzz test group name Darrick J. Wong
2021-09-17  0:39 ` [PATCH 4/8] btrfs: fix incorrect subvolume " Darrick J. Wong
2021-09-17  0:39 ` [PATCH 5/8] generic/631: change this test to use the 'whiteout' group Darrick J. Wong
2021-09-17  0:39 ` [PATCH 6/8] tools: make sure that test groups are described in the documentation Darrick J. Wong
2021-09-17  0:39 ` [PATCH 7/8] tools: add missing license tags to my scripts Darrick J. Wong
2021-09-17  0:39 ` Darrick J. Wong [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-09-02 23:52 [PATCHSET v2 0/8] fstests: document all test groups Darrick J. Wong
2021-09-02 23:53 ` [PATCH 8/8] new: only allow documented test group names Darrick J. Wong
2021-09-04  8:43   ` Amir Goldstein
2021-09-13 19:11     ` Darrick J. Wong

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=163183918676.952957.10906553908004142603.stgit@magnolia \
    --to=djwong@kernel.org \
    --cc=amir73il@gmail.com \
    --cc=fstests@vger.kernel.org \
    --cc=guan@eryu.me \
    --cc=guaneryu@gmail.com \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    --subject='Re: [PATCH 8/8] new: only allow documented test group names' \
    /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

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