On Saturday 29 January 2011, Ralf Wildenhues wrote: > * Stefano Lattarini wrote on Sat, Jan 29, 2011 at 01:48:16PM CET: > > On Saturday 29 January 2011, Ralf Wildenhues wrote: > > > 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). > > Ah no, I meant yaccdry. Sorry for not looking it up before. > But the overlap is not a problem. > > > > > +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. > > > I will push as soon as you ACK the squashed-in diffs. > > I agree with everything except ... > > > BUILT_SOURCES = parse1.h p2-parse2.h > > +main3.@OBJEXT@: parse3.h > > ... this line shouldn't be there, other than to workaround > a bug in automake; > Why not? IMO it increases coverage by showing that, when we know which files include a yacc-generated header, we can just declare dependencies directly instead of relying on the $(BUILT_SOURCES) hack, and still have things work correctly.
> and if it does, then it deserves a comment. > Yes, that could be useful. What about the following squash-in? -*-*-*- diff --git a/tests/yacc-deleted-headers.test b/tests/yacc-deleted-headers.test index ff215c6..6d6a0a1 100755 --- a/tests/yacc-deleted-headers.test +++ b/tests/yacc-deleted-headers.test @@ -39,8 +39,15 @@ 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 + +# When we know which files include a yacc-generated header, we +# should be able to just declare dependencies directly instead +# of relying on the BUILT_SOURCES hack, and things should still +# work correctly. main3.@OBJEXT@: parse3.h + .PHONY: clean-p3 build-p3 build-p3: p3$(EXEEXT) clean-p3: -*-*-*- Thanks, Stefano