automake-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] {yacc-work} tests: more coverage on yacc/lex silent-rules, p


From: Ralf Wildenhues
Subject: Re: [PATCH] {yacc-work} tests: more coverage on yacc/lex silent-rules, plus minor cleanups
Date: Sat, 22 Jan 2011 12:41:49 +0100
User-agent: Mutt/1.5.20 (2010-08-04)

* Stefano Lattarini wrote on Sat, Jan 22, 2011 at 12:28:58PM CET:
> On Friday 21 January 2011, Ralf Wildenhues wrote:
> > 
> > AFAICS it still isn't fully, even after this patch: you don't trigger
> > the "recover from removal of header" rule anywhere.
[...]
> > And if that wasn't the point of the new test in this patch,
[...]
> > then I don't see any reason to add that new test; it can just
> > be dropped.
> >
> I've fixed it now.  See the attached amended patch -- BTW, sorry if
> there's not also a squashed-in diff, but I managed to lose that :-(

No worries.

> > > +$FGREP 'foo2-foo.c' Makefile.in
> > > +$FGREP 'foo2-foo2-foo.o' Makefile.in
[...]
> > Do you *really* think you need to do all of these greps to ensure that
> > things are actually working the same way they have for the last decade?
> >
> Well, not really, but I've become more suspicious since I realised
> that, after my recent commit v1.11-268-g3544a43 "yacc: support variable
> expansions in *YFLAGS definition", the usual idiom to force a "fake"
> yacc compilation with per-object flags:
>   bin_PROGRAMS = foo
>   foo_SOURCES = foo.y
>   foo_YFLAGS = $(AM_YFLAGS)
> does not work anymore (even if it has for the last decade ;->)

Ooh.  I didn't realise that.  Are you going to fix this, or add an
XFAILing test that exposes this change?

> > Won't just one, or maybe two, suffice?
> >
> I guess so; I'll go for these:
>  $FGREP 'foo2-foo.c' Makefile.in
>  $FGREP 'bar2-bar.c' Makefile.in

Sounds good.

> The updated patch is attached.  I will push to 'yacc-work'
> shortly if there are no more objections.

Fine, with a couple of language nits.

Thanks,
Ralf

> * tests/silent-yacc-gcc.test: Add sanity checks verifying that the
> generated Makefile.in files really contains the non-generic rules
> we expect.  Do not redundantly remove by hand files we know to be

s/remove by hand/manually remove/

> already removed "make maintainer-clean".
> (Makefile.am): Ensure we cover also non-generic yacc rules, by
> setting target-specific YFLAGS.
> (sub/Makefile.am): Likewise.
> * tests/silent-yacc-generic.test: Likewise.
> * tests/silent-lex-gcc.test: Likewise, but with LFLAGS instead of
> YFLAGS.
> * tests/silent-lex-generic.test: Likewise.
> * tests/silent-many-gcc.test: Likewise, but with both LFLAGS and
> YFLAGS.  Also ...
> (do_and_check_verbose_build): Remove redundant blank line.
> * tests/silent-many-generic.test: Likewise.
> * tests/silent-yacc-headers.test: New test.
> * tests/Makefile.am (TESTS): Update.

> --- a/tests/silent-many-gcc.test
> +++ b/tests/silent-many-gcc.test

> @@ -182,6 +185,12 @@ $ACLOCAL
>  $AUTOMAKE --add-missing
>  $AUTOCONF
>  
> +# Ensure per-target rules are used, to ensure their coverage below.
> +# (We do not do an exhaustive check, that would be impractical).

I *think* (but I'm really not sure on this one) that the sentence
conveys that an exhaustive check would be impossible.  I usually
write "would not be practical" to avoid giving this impression.

> +$FGREP 'bar-bar.o' Makefile.in
> +$FGREP 'fo2-foo5.c' Makefile.in
> +$FGREP 'fo2-foo6.c' Makefile.in

> --- /dev/null
> +++ b/tests/silent-yacc-headers.test

> +# Check silent-rules mode for Yacc, when yacc-generated headers are
> +# involved (i.e., the `-d' option is in *YFLAGS).
> +
> +required=yacc
> +. ./defs || Exit 1
> +
> +set -e
> +
> +mkdir sub
> +
> +cat >>configure.in <<'EOF'
> +AM_SILENT_RULES
> +AC_PROG_YACC
> +AC_PROG_CC
> +AC_OUTPUT
> +EOF
> +
> +cat > Makefile.am <<'EOF'
> +# Need generic and non-generic rules.
> +AM_YFLAGS = -d
> +bin_PROGRAMS = foo bar
> +foo_SOURCES = parse.y
> +bar_SOURCES = $(foo_SOURCES)
> +bar_YFLAGS = $(AM_YFLAGS)
> +EOF
> +
> +cat > parse.y <<'EOF'
> +%{
> +void yyerror (char *s) { return; }
> +int yylex (void) { return 0; }
> +int main (void) { return 0; }
> +%}
> +%token EOF
> +%%
> +fubar : 'f' 'o' 'o' 'b' 'a' 'r' EOF {};
> +EOF
> +
> +$ACLOCAL
> +$AUTOMAKE --add-missing
> +$AUTOCONF
> +
> +# Check that the expected non-generic rules has been truly generated.

truly have been generated.

> +# Otherwise, the coverage offered by this test will be weaker then
> +# expected and planned.

s/and planned// ?

> +$FGREP 'bar-parse.c' Makefile.in
> +$FGREP '$(bar_YFLAGS)' Makefile.in
[...]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]