[PATCH] test: optionally print subtest number

Dmitry Kurochkin dmitry.kurochkin at gmail.com
Tue Dec 13 12:58:35 PST 2011


On Tue, 13 Dec 2011 22:55:18 +0200, Tomi Ollila <tomi.ollila at iki.fi> wrote:
> On Wed, 14 Dec 2011 00:15:43 +0400, Dmitry Kurochkin <dmitry.kurochkin at gmail.com> wrote:
> > On Tue, 13 Dec 2011 15:56:47 -0400, David Bremner <david at tethera.net> wrote:
> > > From: David Bremner <bremner at debian.org>
> > > 
> > > The idea is that $test_count could be used in tests to label
> > > intermediate files. The output enabled by this patch (and --debug)
> > > helps figure out which OUTPUT.nn file belongs to which test in case
> > > several subtests write to OUTPUT.$test_count
> > > ---
> > > 
> > > Is there something that depends on the test format? I find it pretty
> > > handy to have the subtest numbers, but I don't want to break some
> > > other tools. I followed the existing style of conditionally defining
> > > functions, but maybe someone with more bash-fu can improve that.
> > > 
> > 
> > Looks good to me.  Except for tabs taking too much space.  Perhaps the
> > following would be better?
> > 
> > 	printf "%-4s" "[$(($test_count - 1))]"
> 
> I attempted the same size reduction. Therefore I know that
> this should to be either
> 
>  	printf " %-4s" "[$(($test_count - 1))]"
> or
>  	printf "\t%-4s" "[$(($test_count - 1))]"
> 
> (or something similar) so that there is space betweem BROKEN and [num]
> 

Oh, apparently, not enough testing on my side.

I vote for the first version with a space.

Regards,
  Dmitry

> This takes 4 bytes out from width (and drops tab as field separator)
> (and only few lines goes over 80 char width (some goes even with this
> reduction). So ...
> 
> 
> > Regards,
> >   Dmitry
> 
> Tomi
> 


More information about the notmuch mailing list