Re: [PATCH 2/8] tests: convert various test dirs to setup preamble

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



On Wed, Jun 27, 2018 at 01:34:07PM +0300, Amir Goldstein wrote:
> On Wed, Jun 27, 2018 at 11:20 AM, Dave Chinner <david@xxxxxxxxxxxxx> wrote:
> > From: Dave Chinner <dchinner@xxxxxxxxxx>
> >
> > Convert all the test dirs with a very small number of tests in one
> > go.
> >
> > Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
> > ---
> [...]
> 
> > -rm -f $seqres.full
> > +echo "Silence is golden"
> > +
> > +fio_config=$tmp.fio
> > +fio_results=$tmp.json
> >
> >  _size=$((16 * $LOAD_FACTOR))
> >  cat >$fio_config <<EOF
> > @@ -60,5 +56,5 @@ $FIO_PROG --output-format=json --output=$fio_results $fio_config
> >  _scratch_unmount
> >  cat $fio_results >> $seqres.full
> >  _fio_results_compare $seq $fio_results
> > -echo "Silence is golden"
> > -status=0; exit
> > +
> > +_success
> 
> I realize that without status=0 test will not pass, but it always
> annoys me that echo "Silence is golden" before the end of the test.

That's because it's supposed to be at the start of the test,
documenting the fact that any output from the test is expected to
cause it to fail. That's generally important to know before you get
ot the last line of the test code....

> How about _success_silent to further reduce the boilerplate echo
> "Silence is golden"?

No.  Removing "silence is golden" (and all the variations that have
crept in over the years) and replacing them with
_success_silent can be mostly scripted once everything
has first been converted to call _success. IMO that's a relatively easy followup
patchset, and it's precisely what this initial conversion is supposed to
enable us to do. i.e. make codebase wide setup/completion
maintenance much easier to perform.

So let's not make the hard part of converting 1260 tests to common
setup infrastructure any harder than it already is going to be by
adding lots of other random cleanups into it as well.....

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx
--
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