[libvirt] [PATCH] tests: redo test argv file line wrapping

Daniel P. Berrange berrange at redhat.com
Fri Nov 6 15:38:37 UTC 2015


On Fri, Nov 06, 2015 at 04:32:52PM +0100, Martin Kletzander wrote:
> On Fri, Nov 06, 2015 at 03:20:31PM +0000, Daniel P. Berrange wrote:
> >On Fri, Nov 06, 2015 at 04:00:04PM +0100, Martin Kletzander wrote:
> >>On Fri, Nov 06, 2015 at 01:30:35PM +0000, Daniel P. Berrange wrote:
> >>>Back in
> >>>
> >>> commit bd6c46fa0cfe275c24debc1152cfc5206c04b59b
> >>> Author: Juerg Haefliger <juerg.haefliger at hp.com>
> >>> Date:   Mon Jan 31 06:42:57 2011 -0500
> >>>
> >>>   tests: handle backspace-newline pairs in test input files
> >>>
> >>>all the test argv files were line wrapped so that the args
> >>>were less than 80 characters.
> >>>
> >>>The way the line wrapping was done turns out to be quite
> >>>undesirable, because it often leaves multiple parameters
> >>>on the same line. If we later need to add or remove
> >>>individual parameters, then it leaves us having to redo
> >>>line wrapping.
> >>>
> >>>This commit changes the line wrapping so that every
> >>>single "-param value" is one its own new line. If the
> >>>"value" is still too long, then we break on ',' or ':'
> >>>or ' ' as needed.
> >>>
> >>
> >>What if we fix the syntax-check instead and allow longer than 80
> >>character lines in case they have no space in it, or exactly one space
> >>(to allow --parameter option,option,option,...)?  That would make even
> >>corner cases easier to review, e.g. when you remove or add a parameter
> >>into the long list of parameters.
> >
> >The alternative that I'm actually thinking is that we make
> >syntax-check skip line length on all these .args files.
> >
> >Instead re-run the 'test-wrap-argv.pl' script during
> >syntax-check, and validate that no changeas are made.
> >
> >This will guarantee that all our .args files are always
> >using our ideal formatting / line wrapping rules.
> >
> >Then I could remove these two special cases and just let
> >us have "-arg value" lines exceed 80 characters when
> >they need to
> >
> 
> OK, if that doesn't take more time then then simple check, so that the
> build time isn't getting longer and longer.

As an unscientific benchmark, it takes 0.08 seconds to check all
the .args files on my machine with warm cache. the make syntax-check
will warm the cache already, so we should be fine.


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list