public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Jan Tulak <jtulak@redhat.com>
Cc: fstests@vger.kernel.org, eguan@redhat.com
Subject: Re: [PATCH 2/2] xfstests: filename handling for extended names in ./check was on a wrong place
Date: Mon, 4 Jul 2016 11:46:17 +1000	[thread overview]
Message-ID: <20160704014617.GB27480@dastard> (raw)
In-Reply-To: <1467389347-2055-3-git-send-email-jtulak@redhat.com>

On Fri, Jul 01, 2016 at 06:09:07PM +0200, Jan Tulak wrote:
> The code handling "./check foo/123", when the real test is "foo/123-bar-baz"
> was moved at the earliest position, so everything working with the test
> name/path will know the full name, and no 123/123-bar-baz mix is possible.
> 
> When moving the code, put qutation marks around a wildcard name to prevent
> early expansion

Can you put this in a separate patch so it's easy to see and review?
i.e. move the code in one patch, change the code in a second?

> Signed-off-by: Jan Tulak <jtulak@redhat.com>
> ---
>  check | 27 ++++++++++++++-------------
>  1 file changed, 14 insertions(+), 13 deletions(-)
> 
> diff --git a/check b/check
> index 5be183f..10ae375 100755
> --- a/check
> +++ b/check
> @@ -543,6 +543,20 @@ for section in $HOST_OPTIONS_SECTIONS; do
>  	for seq in $list
>  	do
>  	    err=false
> +		if [ ! -f $seq ]; then
> +			# Try to get full name in case the user supplied only seq id
> +			# and the test has a name. A bit of hassle to find really
> +			# the test and not its sample output or helping files.
> +			bname=$(basename $seq)
> +
> +			full_seq=$(find $(dirname $seq) -name "$bname*" -executable |
> +				awk '(NR == 1 || length < length(shortest)) { shortest = $0 }\
> +					END { print shortest }')
> +			if [ -f $full_seq ] \
> +				&& [ x$(echo $bname | grep -o "^$VALID_TEST_ID") != x ]; then
> +				seq=$full_seq
> +			fi
> +		fi
>  
>  	    # the filename for the test and the name output are different.
>  	    # we don't include the tests/ directory in the name output.

This now has whitespace issues - the indentation does not match the
surrounding context.

Cheers,

Dave.

-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2016-07-04  1:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-01 16:09 [PATCH 0/2] xfstests: extended names fixes Jan Tulak
2016-07-01 16:09 ` [PATCH 1/2] xfstests: Fix installation for extended names Jan Tulak
2016-07-04  1:40   ` Dave Chinner
2016-07-11  9:29     ` Jan Tulak
2016-07-12  2:32       ` Dave Chinner
2016-07-12  7:29         ` Jan Tulak
2016-07-01 16:09 ` [PATCH 2/2] xfstests: filename handling for extended names in ./check was on a wrong place Jan Tulak
2016-07-04  1:46   ` Dave Chinner [this message]
2016-07-11  9:27     ` 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=20160704014617.GB27480@dastard \
    --to=david@fromorbit.com \
    --cc=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=jtulak@redhat.com \
    /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