All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Tulak <jtulak@redhat.com>
To: eguan@redhat.com
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH] fstests: Tests can use any name now, not 3 digits only.
Date: Wed, 25 Mar 2015 09:32:35 -0400 (EDT)	[thread overview]
Message-ID: <379097928.2563673.1427290355063.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1427290055-32647-1-git-send-email-jtulak@redhat.com>

Eryu,
the sorting now puts the named tests at the end of group file and dots can't be in test names any more.

I hope this version looks finally ok.
Anyway, thank you for the feedback. :-)

Cheers,
Jan

----- Original Message -----
> From: "Jan Ťulák" <jtulak@redhat.com>
> To: eguan@redhat.com
> Cc: fstests@vger.kernel.org
> Sent: Wednesday, 25 March, 2015 2:27:35 PM
> Subject: [PATCH] fstests: Tests can use any name now, not 3 digits only.
> 
> Tests can use any name now, not 3 digits only.
> (e.g. a test can be named "tests/generic/some-name")
> 
> The only limitation on a test name is no whitespace and no dot.
> 
> Signed-off-by: Jan Ťulák <jtulak@redhat.com>
> ---
>  README |  2 +-
>  check  | 11 ++++++-----
>  new    | 50 +++++++++++++++++++++++++++++++++++++++++++++++---
>  3 files changed, 54 insertions(+), 9 deletions(-)
> 
> diff --git a/README b/README
> index 0c9449a..2376674 100644
> --- a/README
> +++ b/README
> @@ -205,7 +205,7 @@ Test script environment:
>  
>  Verified output:
>  
> -    Each test script has a numerical name, e.g. 007, and an associated
> +    Each test script has a name, e.g. 007, and an associated
>      verified output, e.g. 007.out.
>  
>      It is important that the verified output is deterministic, and
> diff --git a/check b/check
> index 0830e0c..da0bc31 100755
> --- a/check
> +++ b/check
> @@ -58,7 +58,7 @@ then
>      exit 1
>  fi
>  
> -SUPPORTED_TESTS="[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]"
> +SUPPORTED_TESTS="[^\s.]\+"
>  SRC_GROUPS="generic shared"
>  export SRC_DIR="tests"
>  
> @@ -96,21 +96,22 @@ get_group_list()
>  		l=$(sed -n < $SRC_DIR/$d/group \
>  			-e 's/#.*//' \
>  			-e 's/$/ /' \
> -			-e "s;\(^[0-9][0-9][0-9]\).* $grp .*;$SRC_DIR/$d/\1;p")
> +			-e "s;^\($SUPPORTED_TESTS\).* $grp .*;$SRC_DIR/$d/\1;p")
>  		grpl="$grpl $l"
>  	done
>  	echo $grpl
>  }
>  
> -# find all tests, excluding files that are test metadata such as group
> files.
> -# This assumes that tests are defined purely by alphanumeric filenames with
> no
> -# ".xyz" extensions in the name.
> +# Find all tests, excluding files that are test metadata such as group
> files.
> +# It matches test names against $SUPPORTED_TESTS defined at the top of this
> +# file.
>  get_all_tests()
>  {
>  	touch $tmp.list
>  	for d in $SRC_GROUPS $FSTYP; do
>  		ls $SRC_DIR/$d/* | \
>  			grep -v "\..*" | \
> +			grep "^$SRC_DIR/$d/$SUPPORTED_TESTS"| \
>  			grep -v "group\|Makefile" >> $tmp.list 2>/dev/null
>  	done
>  }
> diff --git a/new b/new
> index d1f8939..6cf67a7 100755
> --- a/new
> +++ b/new
> @@ -84,8 +84,11 @@ eof=1
>  for found in `cat $tdir/group | $AWK_PROG '{ print $1 }'`
>  do
>      line=$((line+1))
> -    if [ -z "$found" ] || [ "$found" == "#" ];then
> -	continue
> +    if [ -z "$found" ] || [ "$found" == "#" ]; then
> +        continue
> +    elif ! echo "$found" | grep -q "^[0-9][0-9][0-9]$"; then
> +        # this one is for tests not named by a number
> +        continue
>      fi
>      i=$((i+1))
>      id=`printf "%03d" $i`
> @@ -99,9 +102,50 @@ if [ $eof -eq 1 ]; then
>     i=$((i+1))
>     id=`printf "%03d" $i`
>  fi
> +auto_id=$id
>  
>  echo "Next test is $id"
>  
> +read -p "Do you want to use ANOTHER name? y,[n]: " -r
> +if [[ "$REPLY" =~ ^[Yy]$ ]]; then
> +    # get the new name from user
> +    id=""
> +    while [ "$id" = "" ]; do
> +        read -p "Enter the new name: "
> +        if [ "$REPLY" = "" ]; then
> +            echo "Can't use empty name. For canceling, use ctrl+c."
> +        elif [ -e "$tdir/$REPLY" ]; then
> +            echo "File '$REPLY' already exists, use another one."
> +            echo #
> +        elif echo "$REPLY" | grep -q "^[^\\s.]\+$"; then
> +            id="$REPLY"
> +        else
> +            echo "Filename must not contain whitespaces and dots!"
> +            echo
> +        fi
> +    done
> +
> +    # now find where to insert this name
> +    eof=1
> +    line=0
> +    for found in `cat $tdir/group | $AWK_PROG '{ print $1 }'`
> +    do
> +        line=$((line+1))
> +        if [ -z "$found" ] || [ "$found" == "#" ]; then
> +            continue
> +        elif [[ "$found" > "$id" ]]; then
> +            eof=0
> +            break
> +        fi
> +    done
> +    if [ $eof -eq 1 ]; then
> +        # If place wasn't found, let $line be the end of the file
> +        line=$((line+1))
> +    fi
> +
> +fi
> +echo "Using '$id'."
> +
>  if [ -f $tdir/$id ]
>  then
>      echo "Error: test $id already exists!"
> @@ -115,7 +159,7 @@ year=`date +%Y`
>  
>  cat <<End-of-File >$tdir/$id
>  #! /bin/bash
> -# FS QA Test No. $id
> +# FS QA Test $id
>  #
>  # what am I here for?
>  #
> --
> 2.1.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2015-03-25 13:32 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04 15:55 [PATCH] Tests can use any name now, not 3 digits only Jan Ťulák
2015-03-18 18:01 ` Jan Tulak
2015-03-20 11:13 ` Eryu Guan
2015-03-20 15:03   ` [PATCH] fstests: tests " Jan Ťulák
2015-03-21  4:49     ` Eryu Guan
2015-03-21 12:02       ` Jan Tulak
2015-03-21 13:11         ` Eryu Guan
2015-03-25 13:27           ` [PATCH] fstests: Tests " Jan Ťulák
2015-03-25 13:32             ` Jan Tulak [this message]
2015-03-25 14:44             ` David Sterba
2015-03-25 15:20               ` Lukáš Czerner
2015-03-25 15:27                 ` Jan Tulak
2015-03-25 15:43                   ` Lukáš Czerner
2015-03-26 13:32                     ` Jan Tulak
2015-03-25 17:09             ` Eryu Guan
2015-03-25 17:39               ` Jan Tulak
2015-03-26 13:35           ` Jan Ťulák
2015-03-26 14:41             ` David Sterba
2015-03-26 15:16               ` Jan Tulak
2015-03-26 15:44                 ` David Sterba
2015-03-26 15:33           ` [PATCH v6] " Jan Ťulák
2015-03-27  7:25             ` Eryu Guan
2015-03-27  9:15               ` Jan Tulak
2015-03-27  9:19                 ` Eryu Guan
2015-03-27  9:15               ` [PATCH v7] " Jan Ťulák
2015-03-27  9:39                 ` Eryu Guan
2015-03-27  9:48                   ` Jan Tulak
2015-03-27 11:15                     ` Eryu Guan
2015-03-27 11:30                       ` Jan Tulak
2015-03-27 11:29               ` [PATCH v8] " Jan Ťulák
2015-03-27 11:49               ` [PATCH v9] " Jan Ťulák
2015-03-27 14:33                 ` Eryu Guan
2015-03-30 13:44                 ` David Sterba
2015-04-01  4:35                 ` Dave Chinner
2015-04-01 12:09                   ` Jan Tulak
2015-04-01 12:15                     ` Lukáš Czerner
2015-04-01 13:17                   ` [PATCH v10] " Jan Ťulák
2015-03-20 15:04   ` [PATCH] " Jan Tulak

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=379097928.2563673.1427290355063.JavaMail.zimbra@redhat.com \
    --to=jtulak@redhat.com \
    --cc=eguan@redhat.com \
    --cc=fstests@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.