Re: [PATCH] fstests: Tests can use any name now, not 3 digits only.

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]




----- Original Message -----
> From: "David Sterba" <dsterba@xxxxxxx>
> To: "Jan Ťulák" <jtulak@xxxxxxxxxx>
> Cc: eguan@xxxxxxxxxx, fstests@xxxxxxxxxxxxxxx, lczerner@xxxxxxxxxx
> Sent: Thursday, 26 March, 2015 3:41:09 PM
> Subject: Re: [PATCH] fstests: Tests can use any name now, not 3 digits only.
> 
> Please put a revision number in the subject so we know what's the latest
> one, eg:
> 
> [PATCH v5] fstests: Tests can use any name now, not 3 digits only
> 
> On Thu, Mar 26, 2015 at 02:35:33PM +0100, Jan Ťulák wrote:
> > Tests can use any name now, not 3 digits only.
> > (e.g. a test can be named "tests/generic/001-some-name")
> > 
> > Names are limited to alphanumeric characters and dash and are always
> > prefixed
> > with an unique id for easier identification of a specific patch.
> 
> patch or test?

Fixed.


> 
> > --- 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.
> 
> I think the naming scheme could be described in the README, probably in
> the "Creating new tests scripts:" section.

True, added into the readme.


> 
> > +if [[ "$REPLY" =~ ^[Yy]$ ]]; then
> 
> You don't need to quote variables in the [[ ]] block as it's a builtin,
> unlike [ (in general). Also, [[ $variable = glob ]] does really match
> globs, so it's simple [[ $REPLY = [yY] ]] if you insist on using [[ .
> 
Thank you for this info, I didn't knew this. :-)

> > +	for found in `tail -n +$line $tdir/group | $AWK_PROG '{ print $1 }'`; do
> > +		foundId=$(echo "$found" | tr - ' ' | $AWK_PROG '{ print $1 }')
> > +		line=$((line+1))
> > +		if [ -z "$found" ] || [ "$found" == "#" ]; then
> > +			continue
> > +		elif [[ "$found" > "$name" ]] || [ "$foundId" -gt "$id" ]; then
> 
> Bash guide advices not to use [[ ]] for arithmetic expressions, in favor
> of (( )). Besides, I find mixing [[ ]] and [ ] inconsistent, choose one.

The [[ "$found" > "$name" ]] is a string expression, for lexicographic ordering. :-)
The second [ ] is for arithmetic - so I used the mix of [[]] and [] deliberately to distinguish it. Though if it is a bad practise, I will stick to not mixing it in one condition.

Jan
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux