bug#10441: The testsuite assumes that ln -s really creates a symlink

2012-01-05 Thread Peter Rosin
Hi!

"ln -s" on MSYS does not create a symlink, instead it makes a
regular copy.  Lots of test cases (on master) FAIL due to this.

"test -h foo" will simply not return success on MSYS, ever.

Affected tests (that I have noticed):
add-missing.tap (lots of failing test cases)
copy.test

Cheers,
Peter





bug#10440: Can't locate TAP/Parser.pm

2012-01-05 Thread Peter Rosin
Hi!

I tried make check on MSYS with the current master, and among other
things, this problem stands out as it FAILs so many test cases.

I'm using tap-bailout-w.test as an example, no use reporting the
same problem 80+ times, right :-)

The perl version is 5.8.8

Here's tap-bailout-w.log:

./tap-bailout-w.test: will source ./tap-bailout.test
Running from installcheck: no
Using TAP: no
PATH = /home/peda/automake/tests:/c/Program Files (x86)/Microsoft 
F#/v4.0/:/c/Program Files (x86)/Microsoft Visual Studio 
10.0/VSTSDB/Deploy:/c/Program Files (x86)/Microsoft Visual Studio 
10.0/Common7/IDE/:/c/Program Files (x86)/Microsoft Visual Studio 
10.0/VC/BIN:/c/Program Files (x86)/Microsoft Visual Studio 
10.0/Common7/Tools/:/c/Windows/Microsoft.NET/Framework/v4.0.30319:/c/Windows/Microsoft.NET/Framework/v3.5:/c/Program
 Files (x86)/Microsoft Visual Studio 10.0/VC/VCPackages:/c/Program Files 
(x86)/HTML Help Workshop:/c/Program Files (x86)/Microsoft Visual Studio 
10.0/Team Tools/Performance Tools:/c/Program Files (x86)/Microsoft 
SDKs/Windows/v7.0A/bin/NETFX 4.0 
Tools:.:/usr/local/bin:/mingw/bin:/bin:/c/Program Files/Common Files/Microsoft 
Shared/Windows Live:/c/Program Files (x86)/Common Files/Microsoft 
Shared/Windows 
Live:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/
+++ pwd
/home/peda/automake/tests/tap-bailout-w.dir
++ . /home/peda/automake/tests/tap-setup.sh
+++ test -f ../defs-static
+++ test -f ../defs
+++ test '!' -f Makefile.am
+++ test -d ../tap-common-setup.dir
+++ cp -Rp ../tap-common-setup.dir/Makefile ../tap-common-setup.dir/Makefile.am 
../tap-common-setup.dir/Makefile.in ../tap-common-setup.dir/aclocal.m4 
../tap-common-setup.dir/config.log ../tap-common-setup.dir/config.status 
../tap-common-setup.dir/configure ../tap-common-setup.dir/configure.in 
../tap-common-setup.dir/depcomp ../tap-common-setup.dir/install-sh 
../tap-common-setup.dir/missing .
+++ fetch_tap_driver
+++ case $am_tap_implementation in
+++ sed '1s|#!.*|#! /bin/perl -w|' /home/peda/automake/lib/tap-driver.pl
+++ chmod a+x tap-driver
+++ sed 10q tap-driver
#! /bin/perl -w
# Copyright (C) 2011 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
+++ test -f Makefile.am~
+++ :
++ :
++ cat
++ cat
++ cat
++ cat
++ cat
++ cat
++ cat
++ echo 'ERROR: d.test - Bail out! mktemp -d: Permission denied'
++ cat
++ echo 'ERROR: e.test - Bail out!'
++ test_counts='total=12 pass=3 fail=1 xpass=1 xfail=1 skip=1 error=5'
++ TESTS='a.test b.test c.test d.test e.test'
++ make -e check
Can't locate TAP/Parser.pm in @INC (@INC contains: /usr/lib/perl5/5.8/msys 
/usr/lib/perl5/5.8 /usr/lib/perl5/site_perl/5.8/msys 
/usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/site_perl/5.8 
/usr/lib/perl5/vendor_perl/5.8/msys /usr/lib/perl5/vendor_perl/5.8 
/usr/lib/perl5/vendor_perl/5.8 .) at ./tap-driver line 33.
BEGIN failed--compilation aborted at ./tap-driver line 33.
make[2]: *** [a.log] Error 2
make[1]: *** [check-TESTS] Error 2
make: *** [check-am] Error 2
++ cat stdout
make  check-TESTS
make[1]: Entering directory `/home/peda/automake/tests/tap-bailout-w.dir'
make[2]: Entering directory `/home/peda/automake/tests/tap-bailout-w.dir'
make[2]: Leaving directory `/home/peda/automake/tests/tap-bailout-w.dir'
make[1]: Leaving directory `/home/peda/automake/tests/tap-bailout-w.dir'
++ count_test_results total=12 pass=3 fail=1 xpass=1 xfail=1 skip=1 error=5
++ total=ERR
++ pass=ERR
++ fail=ERR
++ xpass=ERR
++ xfail=ERR
++ skip=ERR
++ error=ERR
++ eval total=12 pass=3 fail=1 xpass=1 xfail=1 skip=1 error=5
+++ total=12
+++ pass=3
+++ fail=1
+++ xpass=1
+++ xfail=1
+++ skip=1
+++ error=5
++ /bin/grep -E -i '(total|x?pass|x?fail|skip|error)' stdout
++ :
++ rc=0
++ set +e
+++ grep -c '^PASS:' stdout
++ test 0 -eq 3
++ rc=1
+++ grep -c '^XFAIL:' stdout
++ test 0 -eq 1
++ rc=1
+++ grep -c '^SKIP:' stdout
++ test 0 -eq 1
++ rc=1
+++ grep -c '^FAIL:' stdout
++ test 0 -eq 1
++ rc=1
+++ grep -c '^XPASS:' stdout
++ test 0 -eq 1
++ rc=1
+++ grep -c '^ERROR:' stdout
++ test 0 -eq 5
++ rc=1
++ grep '^# TOTAL:  *12$' stdout
++ rc=1
++ grep '^# PASS:  *3$' stdout
++ rc=1
++ grep '^# XFAIL:  *1$' stdout
++ rc=1
++ grep '^# SKIP:  *1$' stdout
++ rc=1
++ grep '^# FAIL:  *1$' stdout
++ rc=1
++ grep '^# XPASS:  *1$' stdout
++ rc=1
++ grep '^# ERROR:  *5$' stdout
++ rc=1
++ test 1 -eq 0
+ exit_status=1
+ set +e
+ cd /home/peda/automake/tests
+ test no = yes
+ case $am_explicit_skips in
+ test 1 -eq 0
+ keep_testdirs=yes
+ am_keeping_testdirs
+ case $keep_testdirs in
+ return 0
+ set +x
tap-bailout-w: exit 1





bug#10436: bug#10427: bug#10436: New testsuite driver and extra trailing backslash in recipes

2012-01-05 Thread Paul Eggert
I pushed the following doc fix into Autoconf, so that these two portability
issues are documented there.  It turns out that the second issue
is actually due to an old Bash bug -- it's not Solaris-specific.

>From b1f0e147aa7aa259dea2c34c5a0ac7965d6efd7e Mon Sep 17 00:00:00 2001
From: Paul Eggert 
Date: Thu, 5 Jan 2012 11:00:45 -0800
Subject: [PATCH 1/2] doc: clarify sed buffer limit

* doc/autoconf.texi (Limitations of Usual Tools):
That 4000-byte limit applies to output and internal buffers, too.
---
 ChangeLog |6 ++
 doc/autoconf.texi |5 +++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 30312be..238c09f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-05  Paul Eggert  
+
+   doc: clarify sed buffer limit
+   * doc/autoconf.texi (Limitations of Usual Tools):
+   That 4000-byte limit applies to output and internal buffers, too.
+
 2012-01-03  Paul Eggert  
 
maint: update copyright year
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 72ff7f8..ea2419b 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -19256,8 +19256,9 @@ $ @kbd{echo a | sed 's/x/x/;;s/x/x/'}
 sed: 1: "s/x/x/;;s/x/x/": invalid command code ;
 @end example
 
-Input should not have unreasonably long lines, since some @command{sed}
-implementations have an input buffer limited to 4000 bytes.  Likewise,
+Some @command{sed} implementations have a buffer limited to 4000 bytes,
+and this limits the size of input lines, output lines, and internal
+buffers that can be processed portably.  Likewise,
 not all @command{sed} implementations can handle embedded @code{NUL} or
 a missing trailing newline.
 
-- 
1.7.6.5


>From 0445b4ad121e6356f409833dec3678ae613e1d08 Mon Sep 17 00:00:00 2001
From: Paul Eggert 
Date: Thu, 5 Jan 2012 12:32:12 -0800
Subject: [PATCH 2/2] doc: mention Bash 2.03 bug with backslash-newline

* doc/autoconf.texi (Invoking the Shell): New section.
(Backslash-Newline-Empty): Rename from Backslash-Newline-Newline.
Mention problem with Bash 2.03.
---
 ChangeLog |5 
 doc/autoconf.texi |   56 +---
 2 files changed, 57 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 238c09f..69df405 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2012-01-05  Paul Eggert  
 
+   doc: mention Bash 2.03 bug with backslash-newline
+   * doc/autoconf.texi (Invoking the Shell): New section.
+   (Backslash-Newline-Empty): Rename from Backslash-Newline-Newline.
+   Mention problem with Bash 2.03.
+
doc: clarify sed buffer limit
* doc/autoconf.texi (Limitations of Usual Tools):
That 4000-byte limit applies to output and internal buffers, too.
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index ea2419b..5c3feef 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -501,6 +501,7 @@ Dependencies Between Macros
 Portable Shell Programming
 
 * Shellology::  A zoology of shells
+* Invoking the Shell::  Invoking the shell as a command
 * Here-Documents::  Quirks and tricks
 * File Descriptors::FDs and redirections
 * Signal Handling:: Shells, signals, and headaches
@@ -520,7 +521,7 @@ Portable Make Programming
 * $< in Ordinary Make Rules::   $< in ordinary rules
 * Failure in Make Rules::   Failing portably in rules
 * Special Chars in Names::  Special Characters in Macro Names
-* Backslash-Newline-Newline::   Empty last lines in macro definitions
+* Backslash-Newline-Empty:: Empty lines after backslash-newline
 * Backslash-Newline Comments::  Spanning comments across line boundaries
 * Long Lines in Makefiles:: Line length limitations
 * Macros and Submakes:: @code{make macro=value} and submakes
@@ -15067,6 +15068,7 @@ subset described above, is fairly portable nowadays.  
Also please see
 
 @menu
 * Shellology::  A zoology of shells
+* Invoking the Shell::  Invoking the shell as a command
 * Here-Documents::  Quirks and tricks
 * File Descriptors::FDs and redirections
 * Signal Handling:: Shells, signals, and headaches
@@ -15205,6 +15207,28 @@ The default Mac OS X @command{sh} was originally Zsh; 
it was changed to
 Bash in Mac OS X 10.2.
 @end table
 
+@node Invoking the Shell
+@section Invoking the Shell
+@cindex invoking the shell
+@cindex shell invocation
+
+Bash 2.03 has a bug when invoked with the @option{-c} option: if the
+option-argument ends in backslash-newline, Bash incorrectly reports a
+syntax error.  The problem does not occur if a character follows the
+backslash:
+
+@example
+$ @kbd{$ bash -c 'echo foo \}
+> @kbd{'}
+bash: -c: line 2: syntax error: unexpected end of file
+$ @kbd{bash -c 'echo foo \}
+> @kbd{ '}
+foo
+@end example
+
+@noindent
+@xref{Backslash-Newline-Empty}, for how this can cause problems in makefiles.
+
 @node Here-Documents
 @sec

bug#10437: bug#10427: bug#10437: parallel-tests: `recheck' recipe can cause sed to be invoked with too long input lines

2012-01-05 Thread Stefano Lattarini
On 01/05/2012 07:24 PM, Stefano Lattarini wrote:
> On 01/05/2012 07:06 PM, Paul Eggert wrote:
>> On 01/05/12 06:07, Stefano Lattarini wrote:
>>> Which "sort of thing" exactly?  I could find only one place which suffers
>>> of the problem you've pointed out, i.e., the `recheck recheck-html' rules
>>> in lib/am/check.am.  Am I missing something?
>>
>> Sorry, that appears to have been a miscount on my part:
>> I was counting some files that Automake generates for itself
>> while building.  In Automake source there are only two instances,
>> which your patch caught: the 'recheck recheck-html' rule and
>> the 'check-TESTS' rule (the latter is what actually triggered
>> the problem with coreutils).
>>
> Wait, the `check-TESTS' rules didn't use any sed invocation, so it wouldn't 
> make
> sense for it to trip for a sed failure ...  What am I missing?
>
I will answer myself: I was missing the fact that such a sed invocation had
been added to check-TESTS, *but in master only*.  Anyway, the maint -> master
merge will take care of everything.

Thanks, and sorry for the noise,
  Stefano





bug#10437: parallel-tests: `recheck' recipe can cause sed to be invoked with too long input lines

2012-01-05 Thread Stefano Lattarini
On 01/05/2012 07:06 PM, Paul Eggert wrote:
> On 01/05/12 06:07, Stefano Lattarini wrote:
>> Which "sort of thing" exactly?  I could find only one place which suffers
>> of the problem you've pointed out, i.e., the `recheck recheck-html' rules
>> in lib/am/check.am.  Am I missing something?
> 
> Sorry, that appears to have been a miscount on my part:
> I was counting some files that Automake generates for itself
> while building.  In Automake source there are only two instances,
> which your patch caught: the 'recheck recheck-html' rule and
> the 'check-TESTS' rule (the latter is what actually triggered
> the problem with coreutils).
>
Wait, the `check-TESTS' rules didn't use any sed invocation, so it wouldn't make
sense for it to trip for a sed failure ...  What am I missing?

Thanks,
  Stefano





bug#10437: parallel-tests: `recheck' recipe can cause sed to be invoked with too long input lines

2012-01-05 Thread Paul Eggert
On 01/05/12 06:07, Stefano Lattarini wrote:
> Which "sort of thing" exactly?  I could find only one place which suffers
> of the problem you've pointed out, i.e., the `recheck recheck-html' rules
> in lib/am/check.am.  Am I missing something?

Sorry, that appears to have been a miscount on my part:
I was counting some files that Automake generates for itself
while building.  In Automake source there are only two instances,
which your patch caught: the 'recheck recheck-html' rule and
the 'check-TESTS' rule (the latter is what actually triggered
the problem with coreutils).  So this should be OK.

Thanks for the quick fixes, by the way!





bug#10437: parallel-tests: `recheck' recipe can cause sed to be invoked with too long input lines

2012-01-05 Thread Stefano Lattarini
Reference:
  

On 01/05/2012 03:07 PM, Stefano Lattarini wrote:
>
> Patch coming up soon.
> 
And here it is.  I will push by this evening if there is no objection.

Regards,
  Stefano
>From e3b0e12400f5fa4220fc0aa79dd0989e56def9c6 Mon Sep 17 00:00:00 2001
Message-Id: 
From: Stefano Lattarini 
Date: Thu, 5 Jan 2012 15:13:30 +0100
Subject: [PATCH] parallel-tests: avoid issue with overly long lines in sed
 input

See automake bug#10437:
  
and coreutils bug#10427:
  

* lib/am/check.am (recheck, recheck-html): In order to strip
trailing whitespace from the definition of the `$list' variable,
we used to invoke sed in a way that could cause it to get passed
overly long input lines, causing spurious failures.  So rework
the logic of the recipe to avoid any sed invocation, relying on
simpler shell idioms instead.
(check-TESTS): Reorganize the recipe to be more similar to the
one of `recheck', for consistency and simplicity.
* NEWS: Update.

Report and analysis by Paul Eggert.
---
 NEWS|4 
 lib/am/check.am |   38 +-
 2 files changed, 25 insertions(+), 17 deletions(-)

diff --git a/NEWS b/NEWS
index 2e572e4..7e52d83 100644
--- a/NEWS
+++ b/NEWS
@@ -89,6 +89,10 @@ Bugs fixed in 1.11.0a:
 
 * Bugs introduced by 1.11:
 
+  - The parallel-tests harness doesn't trip anymore on sed implementations
+with stricter limits on the length of input lines (problem seen at
+least on Solaris 8).
+
   - The `parallel-tests' test driver works around a GNU make 3.80 bug with
 trailing white space in the test list (`TESTS = foo $(EMPTY)'), and
 does not report spurious successes when used with concurrent FreeBSD
diff --git a/lib/am/check.am b/lib/am/check.am
index 3d0188d..29faa38 100644
--- a/lib/am/check.am
+++ b/lib/am/check.am
@@ -245,15 +245,16 @@ check-TESTS:
 ## OTOH, this means that, in the rule for `$(TEST_SUITE_LOG)', we
 ## cannot use `$?' to compute the set of lazily rerun tests, lest
 ## we rely on .PHONY to work portably.
-##
+	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+	@list='' list2='$(TEST_LOGS)'; for f in $$list2; do \
 ## Trailing whitespace in `TESTS = foo.test $(empty)' causes GNU make
 ## 3.80 to erroneously expand $(TESTS_LOGS) to `foo.log .log'.
 ## Work around this bug.
-	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
-	@list='$(TEST_LOGS)';		\
-	list=`for f in $$list; do	\
-	  test .log = $$f || echo $$f;	\
-	done | tr '\012\015' '  '`;	\
+	  test .log = $$f && continue; \
+## Be careful to avoid extra whitespace in the definition of $list.  See
+## comments in `recheck' below for why this might be useful.
+	  if test -z "$$list"; then list=$$f; else list="$$list $$f"; fi; \
+	done; \
 	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$list"
 
 AM_RECURSIVE_TARGETS += check
@@ -298,17 +299,20 @@ AM_RECURSIVE_TARGETS += check-html
 
 ## Rerun all FAILed or XPASSed tests.
 recheck recheck-html:
-	@target=`echo $@ | sed 's,^re,,'`;\
-	list='$(TEST_LOGS)';		\
-	list=`for f in $$list; do	\
-	test -f $$f || continue;\
-	if test -r $$f && read line < $$f; then			\
-	  case $$line in FAIL*|XPASS*) echo $$f;; esac;		\
-	else echo $$f; fi;	\
-	  done | tr '\012\015' '  '`;\
-## This apparently useless munging helps to avoid a nasty bug (a
-## segmentation fault!) on Solaris XPG4 make.
-	list=`echo "$$list" | sed 's/ *$$//'`;\
+	@target=`echo $@ | sed 's,^re,,'`; \
+	list='' list2='$(TEST_LOGS)'; for f in $$list2; do \
+	  test -f $$f || continue; \
+	  if test -r $$f && read line < $$f; then \
+	case $$line in FAIL*|XPASS*) : ;; *) continue;; esac; \
+	  fi; \
+## Be careful to avoid extra whitespace in the definition of $list, since
+## its value will be passed to the recursive make invocation below through
+## the TEST_LOGS macro, and leading/trailing white space in a make macro
+## definition can be problematic.  In this particular case, trailing white
+## space was known to cause a segmentation fault on Solaris 10 XPG4 make:
+## 
+	  if test -z "$$list"; then list=$$f; else list="$$list $$f"; fi; \
+	done; \
 	$(MAKE) $(AM_MAKEFLAGS) $$target AM_MAKEFLAGS='$(AM_MAKEFLAGS) TEST_LOGS="'"$$list"'"'
 
 .PHONY: recheck recheck-html
-- 
1.7.7.3



bug#10437: parallel-tests: `recheck' recipe can cause sed to be invoked with too long input lines (was: Re: bug#10427: coreutils-8.14.116-1e18d: testsuite failures on NetBSD 5.1)

2012-01-05 Thread Stefano Lattarini
[adding bug-automake in CC:]

Reference: 

Hi Paul, thanks for the report and diagnosis.

On 01/05/2012 10:00 AM, Paul Eggert wrote:
> The latest coreutils snapshot fail to build
> 
>> On 01/03/2012 06:10 PM, Jim Meyering wrote:
>>> FYI, here's a snapshot of what will soon be coreutils-8.15,
>>> expected on Thursday or Friday.
>>>
>>> coreutils snapshot:
>>>   http://meyering.net/cu/coreutils-ss.tar.xz  5.2 MB
>>>   http://meyering.net/cu/coreutils-ss.tar.xz.sig
>>>   http://meyering.net/cu/coreutils-8.14.116-1e18d.tar.xz
> 
> This snapshot doesn't build on Solaris 8 (sparc) with native tools,
> for a couple of reasons.  I don't expect Solaris 8 is an active
> porting target any more, but these problems could well happen on
> active targets.
>
I agree.

> Second, there's code like this in tests/Makefile.in:
> 
>   @list='$(TEST_LOGS)'; \
>   list=`for i in $$list; do \
> test .log = $$i || echo $$i; \
>   done | tr '\012\015' '  '`; \
>   list=`echo "$$list" | sed 's/ *$$//'`; \
> 
> This generates a long line and sends it to 'sed',
> which complains "Output line too long." and outputs nothing.
>
And if I'm not mistaken, sed is allowed such a behaviour by POSIX, so this
is a portability problem in automake.

> This code is also generated by Automake.  How about changing Automake
> to generate something like this instead?
> 
>   @test_logs='$(TEST_LOGS)'; \
>   list=; \
>   for i in $$test_logs; do \
> test .log = "$$i" || list="$$list $$i"; \
>   done; \
> 
> This avoids the business with echo and tr and ` sed and
> avoids the sed limitation with long lines.
>
Good idea.  I will followed your idea (with some tweaks).
Patch coming up soon.

> Automake does this latter sort of thing in about 4 places,
>
Which "sort of thing" exactly?  I could find only one place which suffers
of the problem you've pointed out, i.e., the `recheck recheck-html' rules
in lib/am/check.am.  Am I missing something?

> and I figure it's done that way for a reason, but I don't
> know what the reason is.
> 
The comments in lib/am/check.am should be explicative enough.  if not,
that's a (minor) bug, so feel free to report it!

Thanks,
  Stefano





bug#10436: New testsuite driver and extra trailing backslash in recipes

2012-01-05 Thread Stefano Lattarini
On 01/05/2012 01:47 PM, Stefano Lattarini wrote:
> [adding bug-automake in CC:]
> 
> Reference: 
> 
And here is the definitive version of the patch that I'll push by this
evening (to master) if there is no objection.

Thanks,
  Stefano
>From c891eff22b84027ea56cf67b4c5aac55b75390d9 Mon Sep 17 00:00:00 2001
Message-Id: 
From: Stefano Lattarini 
Date: Thu, 5 Jan 2012 13:41:13 +0100
Subject: [PATCH] parallel-tests: avoid trailing backslashes in make recipes

The new testsuite-harness could generate recipes with a trailing
backslash character (possibly followed by blank characters only),
in the very common case where the user hadn't defined the special
$(AM_TESTS_FD_REDIRECT) variable.  This caused spurious syntax
errors with at least older bash versions (e.g., bash 2.05b), and
could be potentially unportable to other weaker shells.

See automake bug#10436:
  
and coreutils bug#10427:
  

* lib/am/check2.am: Rework line breaks so that no backslash can
be at the end of a line.
* tests/parallel-tests-trailing-bslash.test: New test.
* tests/list-of-tests.mk: Add it.
---
 lib/am/check2.am  |   10 +-
 tests/list-of-tests.mk|1 +
 tests/parallel-tests-trailing-bslash.test |  114 +
 3 files changed, 120 insertions(+), 5 deletions(-)
 create mode 100755 tests/parallel-tests-trailing-bslash.test

diff --git a/lib/am/check2.am b/lib/am/check2.am
index ad0a4aa..9a0fe9d 100644
--- a/lib/am/check2.am
+++ b/lib/am/check2.am
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 2008, 2009, 2011 Free Software Foundation, Inc.
+## Copyright (C) 2008, 2009, 2011, 2012 Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -19,8 +19,8 @@
 ?!GENERIC?%OBJ%: %SOURCE%
 	@p='%SOURCE%'; $(am__check_pre) %DRIVER% --test-name "$$f" \
 	--log-file '%BASE%.log' --trs-file '%BASE%.trs' \
-	$(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% "$$tst" \
-	$(AM_TESTS_FD_REDIRECT)
+	$(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
 
 ## If no programs are built in this package, then this rule is removed
 ## at automake time.  Otherwise, %am__EXEEXT% expands to a configure time
@@ -30,6 +30,6 @@ if %am__EXEEXT%
 ?GENERIC?%EXT%$(EXEEXT).log:
 	@p='%SOURCE%'; $(am__check_pre) %DRIVER% --test-name "$$f" \
 	--log-file '%BASE%.log' --trs-file '%BASE%.trs' \
-	$(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% "$$tst" \
-	$(AM_TESTS_FD_REDIRECT)
+	$(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
 endif %am__EXEEXT%
diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk
index 8b4f2ca..dbadfdc 100644
--- a/tests/list-of-tests.mk
+++ b/tests/list-of-tests.mk
@@ -709,6 +709,7 @@ parallel-tests-no-spurious-summary.test \
 parallel-tests-exit-statuses.test \
 parallel-tests-console-output.test \
 parallel-tests-once.test \
+parallel-tests-trailing-bslash.test \
 tests-environment.test \
 am-tests-environment.test \
 tests-environment-backcompat.test \
diff --git a/tests/parallel-tests-trailing-bslash.test b/tests/parallel-tests-trailing-bslash.test
new file mode 100755
index 000..418b722
--- /dev/null
+++ b/tests/parallel-tests-trailing-bslash.test
@@ -0,0 +1,114 @@
+#! /bin/sh
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+
+# Check that the new testsuite harness do not generate recipes that can
+# have a trailing `\', since that can cause spurious syntax errors with
+# older bash versions (e.g., bash 2.05b).
+# See automake bug#10436.
+
+am_parallel_tests=yes
+. ./defs || Exit 1
+
+echo AC_OUTPUT >> configure.in
+
+cat > Makefile.am <<'END'
+TESTS = foo.test
+EXTRA_DIST = $(TESTS)
+am__backslash = \\ # foo
+.PHONY: bad-recipe
+bad-recipe:
+	@printf '%s\n' $(am__backslash)
+END
+
+cat > foo.test <<'END'
+#!/bin/sh
+exit 0
+END
+chmod +x foo.test
+
+am__SHELL=$SHELL; export am__SHELL
+am__PERL=$PERL; export am__PERL
+
+cat > my-shell <<'END'
+#!/bin/sh -e
+set -u
+tab='	'
+nl='
+'
+am__shell_flags=
+am__shell_command=; unset am__shell_command

bug#10436: New testsuite driver and extra trailing backslash in recipes (was: Re: bug#10427: coreutils-8.14.116-1e18d: testsuite failures on NetBSD 5.1)

2012-01-05 Thread Stefano Lattarini
[adding bug-automake in CC:]

Reference: 

Hi Paul, thanks for the report and diagnosis.

On 01/05/2012 10:00 AM, Paul Eggert wrote:
> I'm sending this to bug-automake because I think it's an automake
> issue.  However, the problem causes the latest coreutils snapshot
> to fail to build, so I'm CC'ing to bug-coreutils.
> 
>> On 01/03/2012 06:10 PM, Jim Meyering wrote:
>>> FYI, here's a snapshot of what will soon be coreutils-8.15,
>>> expected on Thursday or Friday.
>>>
>>> coreutils snapshot:
>>>   http://meyering.net/cu/coreutils-ss.tar.xz  5.2 MB
>>>   http://meyering.net/cu/coreutils-ss.tar.xz.sig
>>>   http://meyering.net/cu/coreutils-8.14.116-1e18d.tar.xz
> 
> This snapshot doesn't build on Solaris 8 (sparc) with native tools,
> for a couple of reasons.  I don't expect Solaris 8 is an active
> porting target any more, but these problems could well happen on
> active targets.
>
I agree that this issues might prove a liability on some modern systems
too, and that we should fix them.  (BTW, if you feel like running the
whole automake testsuite on Solaris 8 to find more similar issues, I
wouldn't object ;-)

> First, there's code like this in tests/Makefile.in:
> 
>   $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) 
> -- $(LOG_COMPILE) "$$tst" \
>   $(AM_TESTS_FD_REDIRECT)
> 
> This code is generated by Automake.  Here, AM_TESTS_FD_REDIRECT
> is empty.  Solaris 8 'make' executes the above as follows:
> 
>bash -c '[expansion of previous line] \'
> 
> and Bash complains about a syntax error with the trailing backslash.
>
I can reproduce this with bash 2.05b on Debian.

Attached is a fix for this bug, with a testcase.  The test is quite
elaborate and somewhat hacky, but I'd rather keep it anyway, since
I'm planning to refactor it into an external helper script that will
be used to guard against other unwanted trailing `\' in *all* the
make recipes run in the automake testsuite (that's for a follow-up
patch obviously).

> How about changing Automake to generate something like this instead,
> with no backslash-newline?
> 
>   $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) 
> -- $(LOG_COMPILE) "$$tst" $(AM_TESTS_FD_REDIRECT)
> 
> This should avoid the problem.
>
I ended up breaking the line in a "safer" place instead.  It is enough
to fix the bug.

Regards,
  Stefano
>From 7902852607b596d1a341501d1823da826fb4b4ed Mon Sep 17 00:00:00 2001
Message-Id: <7902852607b596d1a341501d1823da826fb4b4ed.1325767602.git.stefano.lattar...@gmail.com>
From: Stefano Lattarini 
Date: Thu, 5 Jan 2012 13:41:13 +0100
Subject: [PATCH] parallel-tests: avoid trailing backslashes in make recipes

The new testsuite-harness could generate recipes with a trailing
backslash character (possibly followed by blank characters only),
in the very common case where the user hadn't defined the special
$(AM_TESTS_FD_REDIRECT) variable.  This caused spurious syntax
errors with at least older bash versions (e.g., bash 2.05b), and
could be potentially unportable to other weaker shells.

See automake bug#xxx:
  
and coreutils bug#10427:
  

* lib/am/check2.am: Rework line breaks so that no backslash can
be at the end of a line.
* tests/parallel-tests-trailing-bslash.test: New test.
* tests/list-of-tests.mk: Add it.
---
 lib/am/check2.am  |   10 +-
 tests/list-of-tests.mk|1 +
 tests/parallel-tests-trailing-bslash.test |  115 +
 3 files changed, 121 insertions(+), 5 deletions(-)
 create mode 100755 tests/parallel-tests-trailing-bslash.test

diff --git a/lib/am/check2.am b/lib/am/check2.am
index ad0a4aa..9a0fe9d 100644
--- a/lib/am/check2.am
+++ b/lib/am/check2.am
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 2008, 2009, 2011 Free Software Foundation, Inc.
+## Copyright (C) 2008, 2009, 2011, 2012 Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -19,8 +19,8 @@
 ?!GENERIC?%OBJ%: %SOURCE%
 	@p='%SOURCE%'; $(am__check_pre) %DRIVER% --test-name "$$f" \
 	--log-file '%BASE%.log' --trs-file '%BASE%.trs' \
-	$(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% "$$tst" \
-	$(AM_TESTS_FD_REDIRECT)
+	$(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
 
 ## If no programs are built in this package, then this rule is removed
 ## at automake time.  Otherwise, %am__EXEEXT% expands to a configure time
@@ -30,6 +30,6 @@ if %am__EXEEXT%
 ?GENERIC?%EXT%$(EXEEXT).log:
 	@p='%SOURCE%'; $(am__check_pre) %DRIVER% --test-name "$$f" \
 	--log-file '%BASE%.log' --trs-file '%BASE%.trs' \
-	$(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% "$$tst" \
-	$(AM_TESTS_FD_REDIRECT)
+	$(am__common_driver_flags) %DRIVER_FLAGS% -- %CO

bug#7849: new instspc* test failures

2012-01-05 Thread Stefano Lattarini
tags 7849 patch
close 7849
thanks

On 01/05/2012 10:53 AM, Peter Rosin wrote:
> Stefano Lattarini skrev 2012-01-05 09:38:
>> Hi Peter, thanks for the patch.  Looks good, modulo a couple of nits
>> below.  Feel free to push to master when they have been addressed.
> 
> Pushed with nits addressed.  I'm not sure about the strange/strangely
> thing either, but strangely seems safer so...
> 
> The test no longer errors out on MSYS, it's all PASS, XFAIL and SKIPs.
>
Very good!  Then I'm closing the bug report.

Thank you very much for working on this,
  Stefano





bug#7849: new instspc* test failures

2012-01-05 Thread Peter Rosin
Stefano Lattarini skrev 2012-01-05 09:38:
> Hi Peter, thanks for the patch.  Looks good, modulo a couple of nits
> below.  Feel free to push to master when they have been addressed.

Pushed with nits addressed.  I'm not sure about the strange/strangely
thing either, but strangely seems safer so...

The test no longer errors out on MSYS, it's all PASS, XFAIL and SKIPs.

Cheers,
Peter





bug#10434: FAIL: depmod.tap 50 - tru64 [long VPATH] make & remake

2012-01-05 Thread Jim Meyering
Stefano Lattarini wrote:
...
> Unfortunately, I don't have access to a Tru64 system, so I can't do the 
> testing
> myself.

Nor do I.





bug#7849: new instspc* test failures

2012-01-05 Thread Stefano Lattarini
Hi Peter, thanks for the patch.  Looks good, modulo a couple of nits
below.  Feel free to push to master when they have been addressed.

On 01/05/2012 01:35 AM, Peter Rosin wrote:
>
> From 27100f0b94f8e38e8bd30c27277d7ad4e9f4dd1a Mon Sep 17 00:00:00 2001
> From: Peter Rosin 
> Date: Thu, 5 Jan 2012 01:29:27 +0100
> Subject: [PATCH] tests: work around strangeness in MSYS
> 
> MSYS mishandles carriage returns and behaves very strange for
>
s/strange/strangely/?  Not a rhetorical question -- "strangely" seems
more correct to me, but I'm not sure it really is.

> directories with colon in them. It seems that colon-directories are
> somehow mixed up with drive letters.
> 
> Fixes automake bug#7849.
> 
> * tests/instspc.tap: Skip instead of erroring out when $test_string
> is empty for the carriageret case, as that is expected on MSYS. Also,
> for similar reasons, skip instead of erroring out when it is not
> possible to cd into the just created directory, and the directory
> name contains a colon.
>
I assume that, after your changes, this test doesn't error out anymore
and doesn't experience any failure even on MSYS.  Right?  If there are
still failures, it might be worth stating it in the commit message.

> ---
>  tests/instspc.tap |   28 +++-
>  1 files changed, 27 insertions(+), 1 deletions(-)
> 
> diff --git a/tests/instspc.tap b/tests/instspc.tap
> index 9eb145f..2e9641c 100755
> --- a/tests/instspc.tap
> +++ b/tests/instspc.tap
>
The copyright years should be updated (the `update-copyright' script
from gnulib can help you with this chore).

> [SNIP]

Thanks,
  Stefano





bug#10434: FAIL: depmod.tap 50 - tru64 [long VPATH] make & remake

2012-01-05 Thread Stefano Lattarini
On 01/04/2012 08:57 PM, Jim Meyering wrote:
> (latest from git/master)
> I just ran the test suite using the latest and now we're down to 5 failures!
> 
>   # TOTAL: 2478
>   # PASS:  2382
>   # SKIP:  61
>   # XFAIL: 30
>   # FAIL:  5
>   # XPASS: 0
>   # ERROR: 0
> 
>   $ grep '^FAIL:' tests/test-suite.log
>   FAIL: depmod
>   FAIL: depmod.tap 50 - tru64 [long VPATH] make & remake
>   FAIL: depmod.tap 84 - tru64 [absolute VPATH] make & remake
>
About these failures, see also:
  

> Started looking, and this one may be easy to fix:
> 
>   make[1]: Leaving directory 
> `/h/j/w/co/automake/tests/depmod.dir/tru64-long.d/src'
>   make[1]: Entering directory 
> `/h/j/w/co/automake/tests/depmod.dir/tru64-long.d'
>   make[1]: Nothing to be done for `all-am'.
>   make[1]: Leaving directory 
> `/h/j/w/co/automake/tests/depmod.dir/tru64-long.d'
>   + make clean
>   Making clean in src
>   make[1]: Entering directory 
> `/h/j/w/co/automake/tests/depmod.dir/tru64-long.d/src'
>   .deps/foo.Po:3: *** missing separator.  Stop.
>   make[1]: Leaving directory 
> `/h/j/w/co/automake/tests/depmod.dir/tru64-long.d/src'
>   make: *** [clean-recursive] Error 1
>   + result_ 'not ok' 'tru64 [long VPATH] make & remake'
>   + set +x
>   not ok 50 - tru64 [long VPATH] make & remake
>   FAIL: depmod.tap 50 - tru64 [long VPATH] make & remake
>   + cd /h/j/w/co/automake/tests/depmod.dir
>   + not am_keeping_testdirs
> 
> Once you see the contents of the offending foo.Po file:
> (the "\:" on line 3 is the obvious culprit)
> 
>   $ cat tests/depmod.dir/tru64-long.d/src/.deps/foo.Po
>   foo.o: ../../this-is/a-path/which-have/quite-a/long_long_name/src/foo.c \
>../../this-is/a-path/which-have/quite-a/long_long_name/src/foo.h
>   ../../this-is/a-path/which-have/quite-a/long_long_name/src/foo.c \:
>../../this-is/a-path/which-have/quite-a/long_long_name/src/foo.h:
> 
> tap 84 fails for the same reason.
>
The fact is that these failures (as we can experience them, at least) only 
happen
when we are *forcing* the use of the tru64 depmode *to gcc* (which obviously 
isn't
really meant nor expected to handle it); OTOH, the failures do *not* happen with
the Sun C Compiler (5.9 on Solaris 10).  So the real question is: do such 
failures
take place with the Tru64 compiler?  If yes, we really have a bug to fix; if 
not,
the failure is merely a consequence of our messing with forced depmodes, and the
correct fix is to SKIP the affected tests.

Unfortunately, I don't have access to a Tru64 system, so I can't do the testing
myself.

Regards,
   Stefano