[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tests: add a syntax check for last week's global change
From: |
Eric Blake |
Subject: |
Re: [PATCH] tests: add a syntax check for last week's global change |
Date: |
Mon, 28 Nov 2011 12:01:16 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 |
[adding bug-gnulib]
On 11/27/2011 01:17 PM, Jim Meyering wrote:
> Someone should have dinged me ;-)
> Last week I made a global change but forgot to add a matching
> syntax-check rule.
>
>>From 5b3e538b7fc193f8e54b16aeb99b48f28744c1db Mon Sep 17 00:00:00 2001
> From: Jim Meyering <address@hidden>
> Date: Sun, 27 Nov 2011 15:36:06 +0100
> Subject: [PATCH] tests: add a syntax check for last week's global change
"last week's global change" at commit a2c811db was specific to
coreutils, but it stemmed from fallout in changes to gnulib's init.sh, I
think this syntax-check belongs in gnulib. At least libvirt would also
benefit from this syntax check, as it had several cases of passing
'compare' the arguments in the wrong order.
>
> Last week I made a global change, commit a2c811db, `tests: use
> "compare exp out", not "compare out exp"', but forgot to add a
> corresponding syntax check rule. Without that, it is far too
> easy to add a new test or to merge in an old one that would
> be non-conforming. Obviously this is only a heuristic, since
> it relies on the expected-output file to have a name that starts
> with "exp".
> * cfg.mk (sc_prohibit_reversed_compare_failure): Prohibit use of
> compare with reversed arguments.
> ---
> cfg.mk | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
That is, any objections to moving this out of coreutil's cfg.mk and into
gnulib's maint.mk?
>
> diff --git a/cfg.mk b/cfg.mk
> index 0626f48..3c42d5d 100644
> --- a/cfg.mk
> +++ b/cfg.mk
> @@ -280,6 +280,12 @@ sc_prohibit_framework_failure:
> halt='use framework_failure_ instead' \
> $(_sc_search_regexp)
>
> +# In tests, use "compare expected actual", not the reverse.
> +sc_prohibit_reversed_compare_failure:
> + @prohibit='\<compare [^ ]+ (exp|/dev/null)' \
> + halt='reversed compare arguments' \
> + $(_sc_search_regexp)
> +
> ###########################################################
> _p0 = \([^"'/]\|"\([^\"]\|[\].\)*"\|'\([^\']\|[\].\)*'
> _pre = $(_p0)\|[/][^"'/*]\|[/]"\([^\"]\|[\].\)*"\|[/]'\([^\']\|[\].\)*'\)*
> --
> 1.7.8.rc3.31.g017d1
>
>
--
Eric Blake address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [PATCH] tests: add a syntax check for last week's global change,
Eric Blake <=