bug#8784: [PATCH] {maint} distcheck: add support for AM_DISTCHECK_CONFIGURE_FLAGS (was: Re: bug#8784: Support developer-reserved AM_DISTCHECK_CONFIGURE_FLAGS)

2011-06-13 Thread Stefano Lattarini
On Friday 10 June 2011, Stefano Lattarini wrote:
 Reference:
  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8784
 
 On Thursday 02 June 2011, Stefano Lattarini wrote:
  Severity: wishlist
  
  Hello automakers.
  
  Continuing with the good trend of avoiding to impinge on the user
  namespace, we should start supporting AM_DISTCHECK_CONFIGURE_FLAGS
  in addition to DISTCHECK_CONFIGURE_FLAGS, so that the former can be
  reserved for the developer to be set in the 'Makefile.am's, and the
  latter left for the user, packager or tester to use freely.
  
  Sorry for the curtness of this message, but it is thought more as
  a note to self than a bug report proper.
  
  Regards,
Stefano
  
  
 Implemented in the first one of the attached patches.  The second patch
 is a follow-up updating the maintainer-check rules accordingly.
 
 OK for maint?  This should be quite uncontroversial, so I'll push in 72
 hours if there is no review by then.
 
 Regards,
   Stefano
 
I've pushed these patches to maint now.

Regards,
  Stefano





Re: [PATCH] {maint} Warnings about primary/prefix mismatch fixed and extended.

2011-06-13 Thread Stefano Lattarini
On Monday 13 June 2011, Stefano Lattarini wrote:
 
 I've pushed the patch now.
 
 Regards,
   Stefano
 
But the test `primary-prefix-invalid-couples.test' is really too slow.
What about the attached follow-up patch to improve the situation?  It
slightly reduces coverage, but on my system bring the test execution
time from six minutes to fifteen seconds, so it's a good trade-off
IMHO.

I'll push in 48 hours if there is no objection by then.

Regards,
  Stefano
From ed078daae2110f79322c79826be567645ef62ea4 Mon Sep 17 00:00:00 2001
Message-Id: ed078daae2110f79322c79826be567645ef62ea4.1307955521.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Mon, 13 Jun 2011 10:51:57 +0200
Subject: [PATCH] tests: optimize tests on primary/prefix mismatch for speed

* tests/primary-prefix-invalid-couples.test: Partial rewrite, in
order to use just a single automake invocation rather than one
invocation for each invalid primary/prefix couple.  This improves
the test script execution time by an order of magnitude.
Since we are at it, throw in some other improvements to avoid
unrelated automake warnings and failures that could potentially
cause false positives w.r.t. the automake exit status.
---
 ChangeLog |   11 
 tests/primary-prefix-invalid-couples.test |   73 +++--
 2 files changed, 70 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 61be149..e54e01d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-06-13  Stefano Lattarini  stefano.lattar...@gmail.com
+
+	tests: optimize tests on primary/prefix mismatch for speed
+	* tests/primary-prefix-invalid-couples.test: Partial rewrite, in
+	order to use just a single automake invocation rather than one
+	invocation for each invalid primary/prefix couple.  This improves
+	the test script execution time by an order of magnitude.
+	Since we are at it, throw in some other improvements to avoid
+	unrelated automake warnings and failures that could potentially
+	cause false positives w.r.t. the automake exit status.
+
 2011-06-11  Stefano Lattarini  stefano.lattar...@gmail.com
 
 	Warnings about primary/prefix mismatch fixed and extended.
diff --git a/tests/primary-prefix-invalid-couples.test b/tests/primary-prefix-invalid-couples.test
index e80b4c2..88e0817 100755
--- a/tests/primary-prefix-invalid-couples.test
+++ b/tests/primary-prefix-invalid-couples.test
@@ -26,10 +26,17 @@ set -e
 
 oIFS=$IFS # Saved for later.
 
+:  ltmain.sh
+:  texinfo.tex
+:  elisp-comp
+:  py-compile
+:  config.guess
+:  config.sub
+
 cat  configure.in 'END'
 AC_PROG_CC
 AC_PROG_RANLIB
-AC_PROG_LIBTOOL
+AC_SUBST([LIBTOOL], [:]) dnl So that we don't have to require Libtool.
 AM_PROG_GCJ
 AM_PATH_PYTHON
 AM_PATH_LISPDIR
@@ -58,7 +65,7 @@ set +x # Don't be overly verbose.
 
 for prefix in $prefixes; do
   for primary in $primaries; do
-echo ${prefix}_${primary}
+echo ${prefix} ${primary}
   done
 done all.list
 
@@ -120,23 +127,61 @@ for primary in $primaries; do
   done
 done allow.list
 
-set -x # Restore shell xtraces from now on.
+# `html_TEXINFOS' is not yet supported, and might never be.
+grep -v '^html TEXINFOS$' all.list | awk '{print NR, $0}'  t
+mv -f t all.list
 
+# For debugging.
+echo '=== all.list ==='
 cat all.list
+echo '=== allow.list ==='
 cat allow.list
 
-while read x; do
-  grep ^$x$ allow.list /dev/null  continue
-  # To get the expected error message more in detail.
-  IFS=_; set $x; IFS=$oIFS
-  test $# -eq 2 || fatal_ internal error in 'all.list' # Sanity check.
-  prefix=$1
-  primary=$2
+# Create the Makefile.am.
+while read lineno prefix primary; do
+  test -n $prefix  test -n $primary  test 0 -lt $lineno \
+|| fatal_ internal error in 'all.list'
+  pfx='' ext=''
+  case $primary in
+LTLIBRARIES) pfx=lib ext=la;;
+LIBRARIES) pfx=lib ext=a;;
+MANS) ext=man;;
+HEADERS) ext=h;;
+JAVA) ext=java;;
+PYTHON) ext=py;;
+LISP) ext=el;;
+TEXINFOS) ext=texi;;
+  esac
+  test -z $ext || ext=.$ext
+  if test $primary = TEXINFOS; then
+echo @setfilename foo$lineno.info  foo$lineno.texi
+  fi
+  echo ${prefix}_${primary} = ${pfx}foo${lineno}${ext}
+done all.list Makefile.am
+
+# For debugging.
+echo '=== Makefile.am ==='
+cat Makefile.am
+
+set -x # Restore shell xtraces from now on.
+
+AUTOMAKE_fails -a
+
+while read lineno prefix primary; do
+  test -n $prefix  test -n $primary  test 0 -lt $lineno \
+|| fatal_ internal error in 'all.list'
+  grep ^${prefix}_${primary}$ allow.list /dev/null  continue
   errmsg_rx=.*${prefix}dir.* not a legitimate directory .*$primary
-  # Now do the test for this prefix/primary combination.
-  echo $x = foo  Makefile.am
-  AUTOMAKE_fails -a || Exit 1
-  grep ^Makefile\\.am:1:$errmsg_rx stderr || Exit 1
+  grep ^Makefile\\.am:$lineno: $errmsg_rx stderr || Exit 1
 done all.list
 
+# Check that automake really failed only for the expected reason(s).
+grep -v 'dir.* not a legitimate 

Re: [PATCH] {maint} Docs: better documentation for silent make rules.

2011-06-13 Thread Stefano Lattarini
On Thursday 09 June 2011, Stefano Lattarini wrote:
 Reference:
   http://lists.gnu.org/archive/html/automake-patches/2010-12/msg00013.html
 
 Ping on this?  I've rebased the patch against latest maint, done some
 rewordings, and reworked the example (now it's broken into two examples)
 to be both less complex and more informative (IMHO).
 
 I know the patch is far from perfect, but it's a definite improvement over
 the present situation IMO; and we can still do polishing and improvements
 later if the need arises.
 
 I'll push in 72 hours if there is no objection or review by then.
 
 Regards,
   Stefano
 
I've pushed this patch now.

Regards,
  Stefano



[PATCH] {testsuite-work} [PATCH] tests: test mdate-sh with /bin/sh too

2011-06-13 Thread Stefano Lattarini
I will push this in 48 hours if there is no objection.

Regards,
  Stefano
From 1222bfbc2cbf164f7ece4ff952c6798a1d5eb585 Mon Sep 17 00:00:00 2001
Message-Id: 1222bfbc2cbf164f7ece4ff952c6798a1d5eb585.1307961304.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Mon, 13 Jun 2011 12:21:52 +0200
Subject: [PATCH] tests: test mdate-sh with /bin/sh too

* tests/mdate5.test: Fetch the `mdate-sh' script using the
`get_shell_script' function, and run it directly instead of
using `$SHELL'.
* tests/mdate6.test: Likewise.  Since we are at it, make checks
on the `mdate-sh' output stricter, remove now unneeded calls to
aclocal and automake and creation/extension of `configure.in',
`Makefile.am' and `textutils.tex' files, and add a trailing `:'
command.
* tests/Makefile.am (config_shell_tests): Add `mdate5-w.shtst'
and `mdate6-w.shtst'.
---
 ChangeLog |   14 ++
 tests/Makefile.am |2 ++
 tests/Makefile.in |2 ++
 tests/mdate5.test |   33 ++---
 tests/mdate6.test |5 +++--
 5 files changed, 39 insertions(+), 17 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9c88d7d..c202a6d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2011-06-13  Stefano Lattarini  stefano.lattar...@gmail.com
+
+	tests: test mdate-sh with /bin/sh too
+	* tests/mdate5.test: Fetch the `mdate-sh' script using the
+	`get_shell_script' function, and run it directly instead of
+	using `$SHELL'.
+	* tests/mdate6.test: Likewise.  Since we are at it, make checks
+	on the `mdate-sh' output stricter, remove now unneeded calls to
+	aclocal and automake and creation/extension of `configure.in',
+	`Makefile.am' and `textutils.tex' files, and add a trailing `:'
+	command.
+	* tests/Makefile.am (config_shell_tests): Add `mdate5-w.shtst'
+	and `mdate6-w.shtst'.
+
 2011-06-07  Stefano Lattarini  stefano.lattar...@gmail.com
 
 	tests: `lib/' shell scripts transparently tested also with $SHELL
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 91f1a9b..77c4570 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -110,6 +110,8 @@ config_shell_tests = \
   instsh2-w.shtst \
   instsh3-w.shtst \
   mkinst3-w.shtst \
+  mdate5-w.shtst \
+  mdate6-w.shtst \
   missing-w.shtst \
   missing2-w.shtst \
   missing3-w.shtst \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index eba4d1c..532765e 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -401,6 +401,8 @@ config_shell_tests = \
   instsh2-w.shtst \
   instsh3-w.shtst \
   mkinst3-w.shtst \
+  mdate5-w.shtst \
+  mdate6-w.shtst \
   missing-w.shtst \
   missing2-w.shtst \
   missing3-w.shtst \
diff --git a/tests/mdate5.test b/tests/mdate5.test
index dc6ede1..f7c7cfe 100755
--- a/tests/mdate5.test
+++ b/tests/mdate5.test
@@ -18,25 +18,28 @@
 # Test to make sure mdate-sh works correctly.
 
 . ./defs || Exit 1
-cat  configure.in  'END'
-AC_OUTPUT
-END
 
-cat  Makefile.am  'END'
-info_TEXINFOS = textutils.texi
-END
+get_shell_script mdate-sh
 
-cat  textutils.texi  'END'
-@include version.texi
-@setfilename textutils.info
-END
-
-$ACLOCAL
-$AUTOMAKE --add-missing
-
-set x `$SHELL ./mdate-sh Makefile.am`
+set x `./mdate-sh install-sh`
 shift
+echo $* # For debugging.
+
 # Check that mdate output looks like a date:
 test $# = 3
 case $1$3 in *[!0-9]*) Exit 1;; esac
 test $1 -lt 32
+# Hopefully automake will be obsolete in 80 years ;-)
+case $3 in 20[0-9][0-9]) :;; *) Exit 1;; esac
+case $2 in
+  January|February|March|April|May|June|July|August) ;;
+  September|October|November|December) ;;
+  *) Exit 1
+esac
+
+# Stricter checks on the year required a POSIX date(1) command.
+if year=`date +%Y`  test $year -gt 2010; then
+  test $year = $3 || Exit 1
+fi
+
+:
diff --git a/tests/mdate6.test b/tests/mdate6.test
index 94ddb4d..70360e7 100755
--- a/tests/mdate6.test
+++ b/tests/mdate6.test
@@ -23,8 +23,9 @@ file='file  name $a'
 ( :  $file ) \
   || skip_ file name with spaces and metacharacters not accepted
 
-cp $top_testsrcdir/lib/mdate-sh .
-$SHELL ./mdate-sh $file stdout 2stderr ||
+get_shell_script mdate-sh
+
+./mdate-sh $file stdout 2stderr ||
   { cat stdout; cat stderr 2; Exit 1; }
 cat stdout
 cat stderr 2
-- 
1.7.2.3



[FYI] {testsuite-work} tests: don't hard-code the test name in txinfo21.test

2011-06-13 Thread Stefano Lattarini
* tests/txinfo21.test: Use `$me' instead of hard-coding the
current testcase name txinfo21.  Add a trailing `:' command
since we are at it.
---
 ChangeLog   |7 ++
 tests/txinfo21.test |   54 ++
 2 files changed, 35 insertions(+), 26 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ab9a6dd..37c0a69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-06-13  Stefano Lattarini  stefano.lattar...@gmail.com
+
+   tests: don't hard-code test name in txinfo21.test
+   * tests/txinfo21.test: Use `$me' instead of hard-coding the
+   current testcase name txinfo21.  Add a trailing `:' command
+   since we are at it.
+
 2011-06-10  Stefano Lattarini  stefano.lattar...@gmail.com
 
tests: new test dedicated to `--add-missing' and `--copy'
diff --git a/tests/txinfo21.test b/tests/txinfo21.test
index 339011a..786a9e1 100755
--- a/tests/txinfo21.test
+++ b/tests/txinfo21.test
@@ -132,44 +132,46 @@ test ! -f sub/main2.html
 test ! -d rec/main3.html
 
 $MAKE install-html
-test -f share/txinfo21/html/main.html
-test -f share/txinfo21/html/main2.html
-test -d share/txinfo21/html/main3.html
+test -f share/$me/html/main.html
+test -f share/$me/html/main2.html
+test -d share/$me/html/main3.html
 $MAKE uninstall
-test ! -f share/txinfo21/html/main.html
-test ! -f share/txinfo21/html/main2.html
-test ! -d share/txinfo21/html/main3.html
+test ! -f share/$me/html/main.html
+test ! -f share/$me/html/main2.html
+test ! -d share/$me/html/main3.html
 
 $MAKE install-dvi
-test -f share/txinfo21/dvi/main.dvi
-test -f share/txinfo21/dvi/main2.dvi
-test -f share/txinfo21/dvi/main3.dvi
+test -f share/$me/dvi/main.dvi
+test -f share/$me/dvi/main2.dvi
+test -f share/$me/dvi/main3.dvi
 $MAKE uninstall
-test ! -f share/txinfo21/dvi/main.dvi
-test ! -f share/txinfo21/dvi/main2.dvi
-test ! -f share/txinfo21/dvi/main3.dvi
+test ! -f share/$me/dvi/main.dvi
+test ! -f share/$me/dvi/main2.dvi
+test ! -f share/$me/dvi/main3.dvi
 
 dvips --help || skip_ dvips is missing
 
 $MAKE install-ps
-test -f share/txinfo21/ps/main.ps
-test -f share/txinfo21/ps/main2.ps
-test -f share/txinfo21/ps/main3.ps
+test -f share/$me/ps/main.ps
+test -f share/$me/ps/main2.ps
+test -f share/$me/ps/main3.ps
 $MAKE uninstall
-test ! -f share/txinfo21/ps/main.ps
-test ! -f share/txinfo21/ps/main2.ps
-test ! -f share/txinfo21/ps/main3.ps
+test ! -f share/$me/ps/main.ps
+test ! -f share/$me/ps/main2.ps
+test ! -f share/$me/ps/main3.ps
 
 pdfetex --help || pdftex --help \
   || skip_ pdftex and pdfetex are both missing
 
 $MAKE install-pdf
-test -f share/txinfo21/pdf/main.pdf
-test -f share/txinfo21/pdf/main2.pdf
-test -f share/txinfo21/pdf/main3.pdf
-test -f share/txinfo21/pdf/hello
+test -f share/$me/pdf/main.pdf
+test -f share/$me/pdf/main2.pdf
+test -f share/$me/pdf/main3.pdf
+test -f share/$me/pdf/hello
 $MAKE uninstall
-test ! -f share/txinfo21/pdf/main.pdf
-test ! -f share/txinfo21/pdf/main2.pdf
-test ! -f share/txinfo21/pdf/main3.pdf
-test ! -f share/txinfo21/pdf/hello
+test ! -f share/$me/pdf/main.pdf
+test ! -f share/$me/pdf/main2.pdf
+test ! -f share/$me/pdf/main3.pdf
+test ! -f share/$me/pdf/hello
+
+:
-- 
1.7.2.3




[PATCH] {testsuite-work} tests: autogenerate list of wrapped tests for `lib/' shell scripts (was: Re: [PATCH 3/3] {testsuite-work} tests: `lib/' shell scripts transparently tested also with $SHELL)

2011-06-13 Thread Stefano Lattarini
On Tuesday 07 June 2011, Stefano Lattarini wrote:
 On Tuesday 07 June 2011, Peter Rosin wrote:
   +
   +# FIXME: this list might probably be made auto-generated, like
   +# $(parallel_tests) is...  But would that worth the hassle?
   +config_shell_tests = \
   +  compile-w.shtst \
   +  compile2-w.shtst \
   +  compile3-w.shtst \
   +  compile4-w.shtst \
   +  compile5-w.shtst \
   +  compile6-w.shtst \
   +  instsh2-w.shtst \
   +  instsh3-w.shtst \
   +  mkinst3-w.shtst \
   +  missing-w.shtst \
   +  missing2-w.shtst \
   +  missing3-w.shtst \
   +  missing5-w.shtst
  
  I expected to see the ar-lib tests here? Or did you not add those
  since the AM_PROG_AR macro hasn't been merged? But would it hurt
  to test ar-lib with $SHELL prior to that merge?
 
 No, this is just a stupid oversight on my part, sorry.  Which probably
 shows that we indeed should make this list automatically-generated
 after all.  But that's for a follow-up patch IMHO.
 
 Thanks,
   Stefano
 
And here it is.  I'll push in 48 hours if there is no objection by then.

Regards,
  Stefano
From 5ac7081cc229a57df779a134de5b192c6d3519a7 Mon Sep 17 00:00:00 2001
Message-Id: 5ac7081cc229a57df779a134de5b192c6d3519a7.1307981250.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Mon, 13 Jun 2011 14:48:57 +0200
Subject: [PATCH] tests: autogenerate list of wrapped tests for `lib/' shell scripts

* tests/gen-config-shell-tests: New script, generates distributed
makefile snippet `tests/config-shell-tests.am' to list all tests
that use the `get_shell_script' function, with names mangled to
use suffix `-w.shtst', in ...
* tests/Makefile.am (config_shell_tests): ... this macro, whose
definition has been consequently removed from Makefile.am.
(EXTRA_DIST): Distribute the new script.
($(srcdir)/config-shell-tests.am): Generate using the new script.
(include): Include the `config-shell-tests.am' fragment.
* bootstrap: Invoke `tests/gen-config-shell-tests' to generate
`tests/config-shell-tests.am'.
* tests/.gitignore: Ignore `config-shell-tests.am'.
* tests/gen-parallel-tests: Fixlet in heading comments.
---
 ChangeLog|   17 ++
 bootstrap|1 +
 tests/.gitignore |1 +
 tests/Makefile.am|   26 +++
 tests/Makefile.in|   54 +---
 tests/gen-config-shell-tests |   70 ++
 tests/gen-parallel-tests |8 ++--
 7 files changed, 128 insertions(+), 49 deletions(-)
 create mode 100755 tests/gen-config-shell-tests

diff --git a/ChangeLog b/ChangeLog
index c202a6d..d8ca3bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
 2011-06-13  Stefano Lattarini  stefano.lattar...@gmail.com
 
+	tests: autogenerate list of wrapped tests for `lib/' shell scripts
+	* tests/gen-config-shell-tests: New script, generates distributed
+	makefile snippet `tests/config-shell-tests.am' to list all tests
+	that use the `get_shell_script' function, with names mangled to
+	use suffix `-w.shtst', in ...
+	* tests/Makefile.am (config_shell_tests): ... this macro, whose
+	definition has been consequently removed from Makefile.am.
+	(EXTRA_DIST): Distribute the new script.
+	($(srcdir)/config-shell-tests.am): Generate using the new script.
+	(include): Include the `config-shell-tests.am' fragment.
+	* bootstrap: Invoke `tests/gen-config-shell-tests' to generate
+	`tests/config-shell-tests.am'.
+	* tests/.gitignore: Ignore `config-shell-tests.am'.
+	* tests/gen-parallel-tests: Fixlet in heading comments.
+
+2011-06-13  Stefano Lattarini  stefano.lattar...@gmail.com
+
 	tests: test mdate-sh with /bin/sh too
 	* tests/mdate5.test: Fetch the `mdate-sh' script using the
 	`get_shell_script' function, and run it directly instead of
diff --git a/bootstrap b/bootstrap
index 95e51d1..aafc6eb 100755
--- a/bootstrap
+++ b/bootstrap
@@ -106,6 +106,7 @@ dosubst automake.in automake.tmp
 # Create required makefile snippets.
 cd tests
 $BOOTSTRAP_SHELL ./gen-parallel-tests  parallel-tests.am
+$BOOTSTRAP_SHELL ./gen-config-shell-tests  config-shell-tests.am
 $BOOTSTRAP_SHELL ./instspc-tests.sh --generate-makefile  instspc-tests.am
 $BOOTSTRAP_SHELL ./depmod-tests.sh --generate-makefile  depmod-tests.am
 cd ..
diff --git a/tests/.gitignore b/tests/.gitignore
index c309c22..a6d0cce 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -3,6 +3,7 @@ automake-*
 defs-static
 instspc-tests.am
 parallel-tests.am
+config-shell-tests.am
 depmod-tests.am
 *.dir
 *.log
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 77c4570..f66a093 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -93,30 +93,16 @@ $(depmod_tests:.depmod=.log): depmod-tests.sh depmod-data.log
 $(depmod_tests):
 
 
+include $(srcdir)/config-shell-tests.am
+
+$(srcdir)/config-shell-tests.am: gen-config-shell-tests Makefile.am
+	$(AM_V_GEN)($(am__cd) $(srcdir)  $(SHELL) ./gen-config-shell-tests) $@
+EXTRA_DIST += 

[PATCH] {testsuite-work} tests: remove 'test_prefer_config_shell' from the environment (was: Re: [PATCH 3/3] {testsuite-work} tests: `lib/' shell scripts transparently tested also with $SHELL)

2011-06-13 Thread Stefano Lattarini
On Monday 06 June 2011, Stefano Lattarini wrote:
 With the previous commit, the user could prefer the use of $SHELL
 over /bin/sh in some tests checking the Automake-provided shell
 scripts by manually exporting `test_prefer_config_shell' to yes
 in the environment.  With this commit, we ensure that such tests
 *always* and *transparently* run using both $SHELL and /bin/sh
 to execute the checked scripts.  The `test_prefer_config_shell'
 variable becomes an internal detail, and is no more meant to be
 manually defined or overridden.
 
 * tests/defs-static.in: Check that `test_prefer_config_shell' is
 not exported in the environment.  Error out if this is the case.

[HUGE SNIP]

 diff --git a/tests/defs-static.in b/tests/defs-static.in
 index 53d9f93..17ed284 100644
 --- a/tests/defs-static.in
 +++ b/tests/defs-static.in
 @@ -70,7 +70,9 @@ fi
  # Check that the environment is properly sanitized.
  # Having variables exported to the empty string is OK, since our code
  # treats such variables as if they were unset.
 -for var in me required parallel_tests original_AUTOMAKE original_ACLOCAL; do
 +for var in me required parallel_tests test_prefer_config_shell \
 +   original_AUTOMAKE original_ACLOCAL
 +do
if eval test x\\$$var\ != x  env | grep ^$var= /dev/null; then
  echo $argv0: variable \`$var' is set in the environment: \
   this is unsafe 2
 
Hmpf, this should have been complemented by a proper addition to
AM_TEST_ENVIRONMENT in tests/Makefile.am.  I will sooninsh apply
the attached follow-up patch if there is no objection.

Regards,
  Stefano
From 8dbdca111d25761a350c598f7a702c7dc5d3b24b Mon Sep 17 00:00:00 2001
Message-Id: 8dbdca111d25761a350c598f7a702c7dc5d3b24b.1307982004.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Mon, 13 Jun 2011 18:19:53 +0200
Subject: [PATCH] tests: remove 'test_prefer_config_shell' from the environment

Since commit `v1.11-910-g7df1a9b', the once user-overridable
variable `$test_prefer_config_shell' has become an internal
detail, and the test scripts now complain and bail out if it is
set in the environment.

* tests/Makefile.am (AM_TESTS_ENVIRONMENT): Unset the variable
`test_prefer_config_shell' if it is set in the environment.
---
 ChangeLog |   10 ++
 tests/Makefile.am |1 +
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d8ca3bc..f72eaac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2011-06-13  Stefano Lattarini  stefano.lattar...@gmail.com
 
+	tests: remove 'test_prefer_config_shell' from the environment
+	Since commit `v1.11-910-g7df1a9b', the once user-overridable
+	variable `$test_prefer_config_shell' has become an internal
+	detail, and the test scripts now complain and bail out if it is
+	set in the environment.
+	* tests/Makefile.am (AM_TESTS_ENVIRONMENT): Unset the variable
+	`test_prefer_config_shell' if it is set in the environment.
+
+2011-06-13  Stefano Lattarini  stefano.lattar...@gmail.com
+
 	tests: autogenerate list of wrapped tests for `lib/' shell scripts
 	* tests/gen-config-shell-tests: New script, generates distributed
 	makefile snippet `tests/config-shell-tests.am' to list all tests
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f66a093..f0c4e6a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -122,6 +122,7 @@ AM_TESTS_ENVIRONMENT = \
   test x$$me = x || unset me; \
   test x$$required = x || unset required; \
   test x$$parallel_tests = x || unset parallel_tests; \
+  test x$$test_prefer_config_shell || unset test_prefer_config_shell; \
   test x$$original_AUTOMAKE = x || unset original_AUTOMAKE; \
   test x$$original_ACLOCAL = x || unset original_ACLOCAL; \
   AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC; \
-- 
1.7.2.3



[PATCH] {testsuite-work} tests: extend tests on `--add-missing' and `--copy' a bit

2011-06-13 Thread Stefano Lattarini
On Monday 13 June 2011, Stefano Lattarini wrote:
 References:
  http://lists.gnu.org/archive/html/automake-patches/2011-06/msg00048.html
  http://lists.gnu.org/archive/html/automake-patches/2011-06/msg00065.html
 
 I've pushed this patch now.
 
 Regards,
   Stefano
 
I'd like also to add the attached patch, which offers a small increase
in coverage of possible use cases.  I'll push in 48 hours if there is no
objection by then.

Regards,
  Stefano
From fb4ca27a3992f229def170dffeb2c1c8c23d9478 Mon Sep 17 00:00:00 2001
Message-Id: fb4ca27a3992f229def170dffeb2c1c8c23d9478.1307986986.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Mon, 13 Jun 2011 19:42:52 +0200
Subject: [PATCH] tests: extend tests on `--add-missing' and `--copy' a bit

* tests/add-missing.test: Fix typo in heading comments.  Try with
another testcase that install many (but not all) the auxiliary
scripts at once, and uses non-standard (but valid and documented)
setups (e.g., defining YACC in Makefile.am instead of calling
AC_PROG_YACC from configure.in).
* tests/copy.test: Reference `add-missing.test' in heading
comments.  Try few more test scenarios.
---
 ChangeLog  |   11 +
 tests/add-missing.test |   23 ++-
 tests/copy.test|   58 
 3 files changed, 91 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a41dfdf..7139ccb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-06-13  Stefano Lattarini  stefano.lattar...@gmail.com
+
+	tests: extend tests on `--add-missing' and `--copy' a bit
+	* tests/add-missing.test: Fix typo in heading comments.  Try with
+	another testcase that install many (but not all) the auxiliary
+	scripts at once, and uses non-standard (but valid and documented)
+	setups (e.g., defining YACC in Makefile.am instead of calling
+	AC_PROG_YACC from configure.in).
+	* tests/copy.test: Reference `add-missing.test' in heading
+	comments.  Try few more test scenarios.
+
 2011-06-10  Stefano Lattarini  stefano.lattar...@gmail.com
 
 	tests: new test dedicated to `--add-missing' and `--copy'
diff --git a/tests/add-missing.test b/tests/add-missing.test
index f16da39..d6729f3 100755
--- a/tests/add-missing.test
+++ b/tests/add-missing.test
@@ -17,7 +17,7 @@
 # Test that automake complains when required auxiliary files are not
 # found, and that `automake --add-missing' installs the files (and only
 # the files) it's supposed to, and that these files are symlinked by
-# default, but copied if the `--install' option is used.
+# default, but copied if the `--copy' option is used.
 
 . ./defs || Exit 1
 
@@ -297,4 +297,25 @@ AM_PATH_PYTHON
 python_PYTHON = foo.py
 END
 
+: %%% few unrelated auxiliary scripts together %%%
+check_ 'END'
+== Files ==
+py-compile
+depcomp
+ylwrap
+config.sub
+config.guess
+== configure.in ==
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+AC_PROG_CXX
+== Makefile.am ==
+PYTHON = python
+pythondir = $(prefix)/py
+YACC = bison -y
+bin_PROGRAMS = foo
+foo_SOURCES = bar.yxx baz.c++
+python_PYTHON = zardoz.py
+END
+
 :
diff --git a/tests/copy.test b/tests/copy.test
index 714f722..3eb1c9e 100755
--- a/tests/copy.test
+++ b/tests/copy.test
@@ -16,16 +16,74 @@
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
 # Test to make sure `-c' works.  Report from Andris Pavenis.
+# See also the much more in-depth test `add-missing'.
 
 . ./defs || Exit 1
 
+# First a simple test, where the auxdir is automatically determined
+# by automake.
+
 :  Makefile.am
 rm -f install-sh
 
 $ACLOCAL
 $AUTOMAKE -c -a
+ls -l # For debugging.
 
 test -f install-sh
 test ! -h install-sh
 
+# Let's do a couple of more elaborated tests, this time with the auxdir
+# explicitly defined in configure.in.
+
+mkdir sub
+cd sub
+
+cat  configure.in END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([auxdir])
+AM_INIT_AUTOMAKE
+AC_PROG_CC
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat  Makefile.am END
+bin_PROGRAMS = foo
+END
+
+$ACLOCAL
+
+# `automake -a' called without `-c' should create symlinks by default,
+# even when there is already a non-symlinked required auxiliary file.
+
+mkdir auxdir
+echo FAKE-DEPCOMP  auxdir/depcomp
+$AUTOMAKE -a
+ls -l auxdir # For debugging.
+test -f auxdir/install-sh
+test -h auxdir/install-sh
+test -f auxdir/depcomp
+test ! -h auxdir/depcomp
+test FAKE-DEPCOMP = `cat auxdir/depcomp`
+
+# `automake -a -c' should not create symlinks, even when there are
+# already symlinked required auxiliary files.
+
+rm -rf auxdir
+mkdir auxdir
+cd auxdir
+ln -s $top_testsrcdir/lib/missing $top_testsrcdir/lib/install-sh .
+cd ..
+
+$AUTOMAKE -a -c
+ls -l auxdir # For debugging.
+test -f auxdir/install-sh
+test -h auxdir/install-sh
+test -f auxdir/missing
+test -h auxdir/missing
+test -f auxdir/depcomp
+test ! -h auxdir/depcomp
+diff $top_testsrcdir/lib/depcomp auxdir/depcomp
+
 :
-- 
1.7.2.3



Re: [PATCH] {maint} distcheck: add support for AM_DISTCHECK_CONFIGURE_FLAGS (was: Re: bug#8784: Support developer-reserved AM_DISTCHECK_CONFIGURE_FLAGS)

2011-06-13 Thread Stefano Lattarini
On Friday 10 June 2011, Stefano Lattarini wrote:
 Reference:
  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8784
 
 On Thursday 02 June 2011, Stefano Lattarini wrote:
  Severity: wishlist
  
  Hello automakers.
  
  Continuing with the good trend of avoiding to impinge on the user
  namespace, we should start supporting AM_DISTCHECK_CONFIGURE_FLAGS
  in addition to DISTCHECK_CONFIGURE_FLAGS, so that the former can be
  reserved for the developer to be set in the 'Makefile.am's, and the
  latter left for the user, packager or tester to use freely.
  
  Sorry for the curtness of this message, but it is thought more as
  a note to self than a bug report proper.
  
  Regards,
Stefano
  
  
 Implemented in the first one of the attached patches.  The second patch
 is a follow-up updating the maintainer-check rules accordingly.
 
 OK for maint?  This should be quite uncontroversial, so I'll push in 72
 hours if there is no review by then.
 
 Regards,
   Stefano
 
I've pushed these patches to maint now.

Regards,
  Stefano



[FYI] {maint} news: update w.r.t. introduction of AM_DISTCHECK_CONFIGURE_FLAGS (was: Re: [PATCH] {maint} distcheck: add support for AM_DISTCHECK_CONFIGURE_FLAGS)

2011-06-13 Thread Stefano Lattarini
On Monday 13 June 2011, Stefano Lattarini wrote:
 On Friday 10 June 2011, Stefano Lattarini wrote:
  Reference:
   http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8784
  
  On Thursday 02 June 2011, Stefano Lattarini wrote:
   Severity: wishlist
   
   Hello automakers.
   
   Continuing with the good trend of avoiding to impinge on the user
   namespace, we should start supporting AM_DISTCHECK_CONFIGURE_FLAGS
   in addition to DISTCHECK_CONFIGURE_FLAGS, so that the former can be
   reserved for the developer to be set in the 'Makefile.am's, and the
   latter left for the user, packager or tester to use freely.
   
   Sorry for the curtness of this message, but it is thought more as
   a note to self than a bug report proper.
   
   Regards,
 Stefano
   
   
  Implemented in the first one of the attached patches.  The second patch
  is a follow-up updating the maintainer-check rules accordingly.
  
  OK for maint?  This should be quite uncontroversial, so I'll push in 72
  hours if there is no review by then.
  
  Regards,
Stefano
  
 I've pushed these patches to maint now.
 
 Regards,
   Stefano
 
And just now I note that I've forgotten to add a peoper NEWS entry.  Sigh.

Fixed with the attached patch.

Sorry for the noise,
  Stefano
From 5aad6b2552953fbf15f7df672538281b513beff9 Mon Sep 17 00:00:00 2001
Message-Id: 5aad6b2552953fbf15f7df672538281b513beff9.1307994166.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Mon, 13 Jun 2011 21:40:57 +0200
Subject: [PATCH] news: update w.r.t. introduction of AM_DISTCHECK_CONFIGURE_FLAGS

* NEWS (Miscellaneous changes): Update.
---
 ChangeLog |5 +
 NEWS  |8 
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6d8233e..f18647a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-06-13  Stefano Lattarini  stefano.lattar...@gmail.com
+
+	news: update w.r.t. introduction of AM_DISTCHECK_CONFIGURE_FLAGS
+	* NEWS (Miscellaneous changes): Update.
+
 2011-06-10  Stefano Lattarini  stefano.lattar...@gmail.com
 
 	maintcheck: DISTCHECK_CONFIGURE_FLAGS can be defined on make cmdline
diff --git a/NEWS b/NEWS
index b7f9b54..e292474 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,14 @@ New in 1.11.0a:
   - The `lzma' compression scheme and associated automake option `dist-lzma'
 is obsoleted by `xz' and `dist-xz' due to upstream changes.
 
+  - A developer that needs to pass specific flags to configure at make
+distcheck time can now, and indeed he's advised to, do so by defining
+the developer-reserved makefile variable AM_DISTCHECK_CONFIGURE_FLAGS,
+instead of the old DISTCHECK_CONFIGURE_FLAGS.
+The DISTCHECK_CONFIGURE_FLAGS variable should now be reserved for the
+user; still, the old Makefile.am files that used to define it should
+still continue to work as before.
+
 Bugs fixed in 1.11.0a:
 
 * Bugs introduced by 1.11:
-- 
1.7.2.3



Re: flex header file

2011-06-13 Thread Stefano Lattarini
[adding bug-automake, so that we won't forgot about this report]

On Monday 13 June 2011, Pippijn van Steenhoven wrote:
 Hi,
 
 in some of my projects, I use (reentrant) flex with the header-file
 option. This causes flex to generate a .h file in addition to the usual
 lex.yy.c file. However, ylwrap doesn't know about this. What would be the
 correct way to use flex with header files?

I see two ways out, not mutually exclusive:

 1. Introduce a new automake option `no-ylwrap', instructing automake not
to use ylwrap to process Yacc and Lex files; this should assume that
bison and flex can be used, so that we know no problem with concurrent
make will arise (we can use the `--output' option for both tools).
Then you can manually add some rules about the header on your
Makefile.am, without ylwrap getting in your way.

 2. Improve ylwrap and automake Lex support to recognize the `--header'
Lex option, similarly to what is done for the `-d' Yacc option, and
emit code handling the header creation, dependencies, etc.

Regards,
  Stefano