automake-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] {yacc-work} coverage: more on 'yacc -d' and recovery from de


From: Stefano Lattarini
Subject: Re: [PATCH] {yacc-work} coverage: more on 'yacc -d' and recovery from deleted headers
Date: Sat, 29 Jan 2011 13:48:16 +0100
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

On Saturday 29 January 2011, Ralf Wildenhues wrote:
> * Stefano Lattarini wrote on Fri, Jan 28, 2011 at 05:01:11PM CET:
> > OK for the 'yacc-work' branch?  I will push in 72 hours if
> > there's no objection.
> 
> OK with nits addressed.
> 
> FYI, I think the test has some overlap with one of the make -n tests
> that ensures the deleted header recovery doesn't build files in dry
> run mode.
>
Not exactly; it partly (and minimally) overlaps with `yacc7.test' (which
is an hodgepodge anyway), and with `yacc8.test' (which checks the
behaviour of the subdir-objects option).

> Thanks,
> Ralf
> 
> > coverage: more on 'yacc -d' and recovery from deleted headers
> > 
> > * tests/yacc-deleted-headers.test: New test.
> > * tests/Makefile.am (TESTS): Update.
> 
> > diff --git a/tests/yacc-deleted-headers.test 
> > b/tests/yacc-deleted-headers.test
> > new file mode 100644
> 
> Please fix the mode to be 755.
>
Oops.  Fixed.

> > index 0000000..f47b70e
> > --- /dev/null
> > +++ b/tests/yacc-deleted-headers.test
> 
> > +# Tests that we can recover from deleted headers generated by `yacc -d'.
> > +
> > +required=yacc
> > +. ./defs || Exit 1
> > +
> > +set -e
> > +
> > +cat >> configure.in << 'END'
> > +AC_PROG_CC
> > +AC_PROG_YACC
> > +AC_OUTPUT
> > +END
> > +
> > +cat > Makefile.am <<'END'
> > +bin_PROGRAMS = p1 p2 p3 p4
> > +p1_SOURCES = parse1.y main1.c
> > +p2_SOURCES = parse2.y main2.c
> > +p3_SOURCES = parse3.y main3.c parse3.h
> > +p4_SOURCES = parse4.y
> > +AM_YFLAGS = -d
> > +p2_YFLAGS = -d
> > +BUILT_SOURCES = parse1.h p2-parse2.h
> 
> Interestingly, the test also passes for me when I omit the BUILT_SOURCES
> line.  Bug in the test or just incidental?
>
Bug, sort of.  The test with BUILT_SOURCES removed passes for me too
if 'make' is not run in parallele mode, but fails with:

  $ MAKE='make -j2' ./yacc-deleted-headers.test

By changing the order in which files are listed in the p{1,2}_SOURCES
variables, I can make the test fail consistently if the BUILT_SOURCES
definition is removed.  See the squash-in below.

But there's more.  If I also make `main3.c' be the first entry in
p3_SOURCES, the test consistently fails because make tries to build
`main3.o' before the header `parse3.h' is created by yacc.  This
is fixed by the squash-in, too.

> If the latter, then ok, if the former, then please add coverage
> for this.  Thanks.
> 
> > +# parse4.h is not declared in any *_SOURCES variable, nor
> > +# #included by any C source file, so that it shouldn't be
> 
> s/that //
>
Fixed.

> > +# rebuilt by "make all".
> > +test ! -r parse4.h
> 

I will push as soon as you ACK the squashed-in diffs.

Thanks,
   Stefano

-*-*-*-

diff --git a/tests/yacc-deleted-headers.test b/tests/yacc-deleted-headers.test
old mode 100644
new mode 100755
index f47b70e..ff215c6
--- a/tests/yacc-deleted-headers.test
+++ b/tests/yacc-deleted-headers.test
@@ -29,13 +29,18 @@ END
 
 cat > Makefile.am <<'END'
 bin_PROGRAMS = p1 p2 p3 p4
-p1_SOURCES = parse1.y main1.c
-p2_SOURCES = parse2.y main2.c
-p3_SOURCES = parse3.y main3.c parse3.h
+# The order in which files are listed in the p*_SOURCES variables
+# below is significant, since it causes make failures whenever
+# the proper definition of BUILT_SOURCES or the declaration of
+# extra dependencies for `main3.o' are removed.
+p1_SOURCES = main1.c parse1.y
+p2_SOURCES = main2.c parse2.y
+p3_SOURCES = main3.c parse3.y parse3.h
 p4_SOURCES = parse4.y
 AM_YFLAGS = -d
 p2_YFLAGS = -d
 BUILT_SOURCES = parse1.h p2-parse2.h
address@hidden@: parse3.h
 .PHONY: clean-p3 build-p3
 build-p3: p3$(EXEEXT)
 clean-p3:
@@ -146,9 +151,8 @@ $MAKE all
 test -f parse1.h
 test -f p2-parse2.h
 test -f parse3.h
-# parse4.h is not declared in any *_SOURCES variable, nor
-# #included by any C source file, so that it shouldn't be
-# rebuilt by "make all".
+# parse4.h is not declared in any *_SOURCES variable, nor #included
+# by any C source file, so it shouldn't be rebuilt by "make all".
 test ! -r parse4.h
 
 :




reply via email to

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