Re: [FYI] {maint} Tests: fix spurious failures in silent*.test for $CC != gcc

2010-11-28 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Thu, Nov 25, 2010 at 11:00:41PM CET:
 I pushed the attached patch to maint, and merged into master and
 branch-1.11.

Thank you, that looks good.  I haven't had a chance to test this,
though, with Savannah still down (see
http://identi.ca/group/fsfstatus).

Cheers,
Ralf

 See real-world motivations for this patch at:
  http://lists.gnu.org/archive/html/automake-patches/2010-11/msg00222.html
  http://lists.gnu.org/archive/html/automake-patches/2010-11/msg00223.html

 -*-*-*-
 
 Fix spurious silent*.test failures for $CC != gcc
 
 In some tests on automake-produced silent rules, we forced the
 use of gcc depmode to improve testsuite coverage; but this has
 unsurprisingly led to spurious failures when some non-GNU C
 compilers were used.  So we are now careful to require GCC in
 tests that force gcc depmode.
 
 From reports by Ralf Wildenhues.
 
 * silent5.test: Test removed, its content split into ...
 * silent-many-generic.test, silent-many-gcc.test: ... these new
 sister tests, the latter of which forces gcc depmode and lists
 gcc in $required.
 * silentlex.test: Test removed, its content split into ...
 * silent-lex-generic.test, silent-lex-gcc.test: ... these new
 sister tests, the latter of which forces gcc depmode and lists
 gcc in $required.
 * silentyacc.test: Test removed, its content split into ...
 * silent-yacc-generic.test, silent-yacc-gcc.test: ... these new
 sister tests, the latter of which forces gcc depmode and lists
 gcc in $required.
 * tests/Makefile.am (TESTS): Updated.



Re: [PATCH] {master} Improve and extend tests on `:=' variable assignments.

2010-11-28 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Thu, Nov 25, 2010 at 02:37:28PM CET:
 The attached patch is based off of maint, and intended for master.
 OK to apply?

With nits addressed.

Thanks,
Ralf

 Improve and extend tests on `:=' variable assignments.
 
 * tests/colneq.test: Avoid useless use of wildcards and extra
 variable assignments in Makefile.am.  Use command-line automake
 options instead of editing AUTOMAKE_OPTIONS in Makefile.am.
 Make grepping of the generated Makefile.in slightly stricter.
 Add a trailing `:' command.
 * tests/colneq.test: Avoid useless use of EXTRA_DIST special
 variable in Makefile.am.  Do not create dummy files which are
 not needed anymore.  Also run autoconf, ./configure and make.
 Add a trailing `:' command.
 * tests/colneq3.test: New test, similar to colneq.test, but
 running ./configure and make.
 * tests/Makefile.am (TESTS): Update.

 --- a/tests/colneq.test
 +++ b/tests/colneq.test

 @@ -21,14 +22,14 @@
  set -e
  
  cat  Makefile.am  'END'
 -ICONS := $(wildcard *.xbm)

Please leave the wildcard line in.  Removing it makes assumptions about
the parser.

 -data_DATA = $(ICONS)
 +FOOBAR := zardoz
  END
  
  $ACLOCAL
  AUTOMAKE_fails
  grep ':=.*not portable' stderr
  
 -echo 'AUTOMAKE_OPTIONS = -Wno-portability'  Makefile.am
 -$AUTOMAKE
 -grep 'ICONS :=' Makefile.in
 +$AUTOMAKE -Wno-portability
 +grep '^FOOBAR *:= *zardoz *$' Makefile.in
 +
 +:

 --- a/tests/colneq2.test
 +++ b/tests/colneq2.test
 @@ -20,14 +20,23 @@
  
  set -e
  
 +cat  configure.in  'END'
 +AC_OUTPUT
 +END
 +
  cat  Makefile.am  'END'
  t = a b c
 -EXTRA_DIST = $(t:=.test)

Please leave the EXTRA_DIST line in.  It is something different if
automake skips a normal variable containing this, and a variable that is
special to automake.

 +FOO = $(t:=.test)
 +.PHONY: test
 +test:
 + test x'$(FOO)' = x'a.test b.test c.test'
  END
  
 -:  a.test
 -:  b.test
 -:  c.test
 -
  $ACLOCAL
 +$AUTOCONF
  $AUTOMAKE
 +
 +./configure
 +$MAKE test
 +
 +:

 --- /dev/null
 +++ b/tests/colneq3.test
 @@ -0,0 +1,46 @@

 +# Test that := definitions work as expected at make time.
 +
 +required=GNUmake
 +. ./defs || Exit 1
 +
 +set -e
 +
 +cat  configure.in  'END'
 +AC_OUTPUT
 +END
 +
 +cat  Makefile.am  'END'
 +BAR := $(FOO)
 +BAZ = $(FOO)
 +FOO := foo

Uh, oh.  Thin ice.  This is OK, but we gotta remember that it won't
work reliably if some of these variables are actually automake-set
before they are overridden.  automake generally orders all of its
variable settings before all of the user ones (so the user ones are
preferred).  When I override, e.g., libdir here, however, it doesn't
get reordered to the user part.  I wonder whether that is a bug in
automake.

 +.PHONY: test
 +test:
 + test x'$(FOO)' = x'foo'
 + test x'$(BAZ)' = x'foo'
 + test x'$(BAR)' = x
 +END
 +
 +$ACLOCAL
 +$AUTOCONF
 +$AUTOMAKE -Wno-portability 

Trailing white space.

 +
 +./configure
 +$MAKE test
 +
 +: