Re: [PATCH] Test `$(var:suf=rpl)' expansion in special automake variables.

2010-12-19 Thread Stefano Lattarini
On Saturday 18 December 2010, Ralf Wildenhues wrote:
 * Stefano Lattarini wrote on Sat, Dec 18, 2010 at 10:35:43AM CET:
  On Saturday 18 December 2010, Ralf Wildenhues wrote:
+# Try also with `:=', to ensure the parser is not unduly confused
+# into thinking that it's an unportable assignement operator.
   
   This comment is bogus, right?  There is no such thing as ':=' within
   $(var:A=B),
  but there is in $(var:=x) (below this is $(t1:=.sh)).
  
   and the code below does not use := to assign variables.
  
  Indeed, and so we want to enssure the automake parser does not 
  (errenously) think we are trying to do so.
  
   What do you mean with this text?  Also try an empty match suffix.?
  
  Yes; maybe a comment like this would be better?

   # Also try an empty match suffix, to ensure that the `:=' in there is
   # not confused by the parser with an unportable assignement operator.
 
 Yes, thanks.

Done and pushed to master (see first attachement).

   These 'test -x' commands fail on MinGW/MSYS because the file system does
   not actually have execute permission information.
  
  Ouch.
  
   Instead, it is emulated by looking at the file, and returning 0 if the
   file starts with, e.g., a COFF header or with '#!'.
   (The same heuristic is used when executing a script as well.)
   
   You can thus fix this by either creating actual scripts in above rules
   and the file creation below, or by removing the tests here.  I'm not
   sure which you prefer.
  
  I'd prefer the former, to keep the coverage a little bigger on non-MinGW
  systems.  Is that ok?
 
 Yes, that's what I meant.

Done and pushed to master (see second attachement).

Thanks,
   Stefano
From 080d362b919118033d054cb80b85cffc6d94cab6 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Sat, 18 Dec 2010 12:58:04 +0100
Subject: [PATCH 1/2] Improve comments in tests `posixsubst*.test'.

* tests/posixsubst-data.test: Improve comment explaining why we
try also empty match suffix.
* tests/posixsubst-extradist.test: Likewise.
* tests/posixsubst-ldadd.test: Likewise.
* tests/posixsubst-libraries.test: Likewise.
* tests/posixsubst-ltlibraries.test: Likewise.
* tests/posixsubst-programs.test: Likewise.
* tests/posixsubst-scripts.test: Likewise.
* tests/posixsubst-sources.test: Likewise.
* tests/posixsubst-tests.test: Likewise.

Suggested by Ralf Wildenhues.
---
 ChangeLog |   15 +++
 tests/posixsubst-data.test|4 ++--
 tests/posixsubst-extradist.test   |4 ++--
 tests/posixsubst-ldadd.test   |4 ++--
 tests/posixsubst-libraries.test   |4 ++--
 tests/posixsubst-ltlibraries.test |4 ++--
 tests/posixsubst-programs.test|4 ++--
 tests/posixsubst-scripts.test |4 ++--
 tests/posixsubst-sources.test |4 ++--
 tests/posixsubst-tests.test   |4 ++--
 10 files changed, 33 insertions(+), 18 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index abeaf00..6a27347 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2010-12-18  Stefano Lattarini  stefano.lattar...@gmail.com
+
+	Improve comments in tests `posixsubst*.test'.
+	* tests/posixsubst-data.test: Improve comment explaining why we
+	try also empty match suffix.
+	* tests/posixsubst-extradist.test: Likewise.
+	* tests/posixsubst-ldadd.test: Likewise.
+	* tests/posixsubst-libraries.test: Likewise.
+	* tests/posixsubst-ltlibraries.test: Likewise.
+	* tests/posixsubst-programs.test: Likewise.
+	* tests/posixsubst-scripts.test: Likewise.
+	* tests/posixsubst-sources.test: Likewise.
+	* tests/posixsubst-tests.test: Likewise.
+	Suggested by Ralf Wildenhues.
+
 2010-12-16  Ralf Wildenhues  ralf.wildenh...@gmx.de
 
 	Fix typos in test comments.
diff --git a/tests/posixsubst-data.test b/tests/posixsubst-data.test
index f1ffeae..210279f 100755
--- a/tests/posixsubst-data.test
+++ b/tests/posixsubst-data.test
@@ -36,8 +36,8 @@ bar.data bazzardoz:
 	:  $@
 CLEANFILES = bar.data bazzardoz
 
-# Try also with `:=', to ensure the parser is not unduly confused
-# into thinking that it's an unportable assignment operator.
+# Also try an empty match suffix, to ensure that the `:=' in there is
+# not confused by the parser with an unportable assignment operator.
 dist_foo_DATA = $(t1:=.txt)
 foo_DATA = $(t2:x=.data)
 nodist_foo_DATA = $(t3:.y=zardoz)
diff --git a/tests/posixsubst-extradist.test b/tests/posixsubst-extradist.test
index c3bf970..c9a20bf 100755
--- a/tests/posixsubst-extradist.test
+++ b/tests/posixsubst-extradist.test
@@ -29,8 +29,8 @@ cat  Makefile.am  'END'
 t1 = foo1 foo2
 t2 = bar.x
 t3 = baz-y
-# Try also with `:=', to ensure the parser is not unduly confused
-# into thinking that it's an unportable assignment operator.
+# Also try an empty match suffix, to ensure that the `:=' in there is
+# not confused by the parser with an unportable assignment operator.
 EXTRA_DIST = $(t1:=.c) $(t2:.x=.f) $(t3:-y=ar)
 bazar bar.f:
 	:  $@
diff --git a/tests/posixsubst-ldadd.test 

Re: [PATCH] Test `$(var:suf=rpl)' expansion in special automake variables.

2010-12-18 Thread Stefano Lattarini
On Saturday 18 December 2010, Ralf Wildenhues wrote:
 Hello Stefano,
 
 * Stefano Lattarini wrote on Thu, Dec 09, 2010 at 01:46:48PM CET:
  Test `$(var:suf=rpl)' expansion in special automake variables.
  
  * tests/posixsubst-data.test: New test.
 [...]
  * tests/posixsubst-scripts.test: Likewise.
 
  --- /dev/null
  +++ b/tests/posixsubst-scripts.test
  @@ -0,0 +1,89 @@
 
  +# Test that POSIX variable expansion `$(var:str=rpl)' works when used
  +# with the SCRIPTS primary.
 
  +cat  configure.in  'END'
  +AC_OUTPUT
  +END
  +
  +cat  Makefile.am  'END'
  +t1 = foo1 foo2
  +t2 = bar1x bar2
  +t3 = quu-baz
  +
  +bar1 bar2 quux.pl:
  +   :  $@
  +CLEANFILES = bar1 bar2 quux.pl
  +
  +# Try also with `:=', to ensure the parser is not unduly confused
  +# into thinking that it's an unportable assignement operator.
 
 This comment is bogus, right?  There is no such thing as ':=' within
 $(var:A=B),
but there is in $(var:=x) (below this is $(t1:=.sh)).

 and the code below does not use := to assign variables.

Indeed, and so we want to enssure the automake parser does not 
(errenously) think we are trying to do so.

 What do you mean with this text?  Also try an empty match suffix.?

Yes; maybe a comment like this would be better?
  
 # Also try an empty match suffix, to ensure that the `:=' in there is
 # not confused by the parser with an unportable assignement operator.

 (Repetitious as it is, it the same text is in all the other tests of
 this patch as well.)
 
  +installcheck-local:
  +   ls -l $(prefix)/libexec $(prefix)/bin $(prefix)/sbin
  +   test -f $(prefix)/sbin/foo1.sh
  +   test -x $(prefix)/sbin/foo1.sh
  +   test -f $(prefix)/sbin/foo2.sh
  +   test -x $(prefix)/sbin/foo2.sh
  +   test -f $(prefix)/libexec/bar1
  +   test -x $(prefix)/libexec/bar1
  +   test -f $(prefix)/libexec/bar2
  +   test -x $(prefix)/libexec/bar2
  +   test -f $(prefix)/bin/quux.pl
  +   test -x $(prefix)/bin/quux.pl
 
 These 'test -x' commands fail on MinGW/MSYS because the file system does
 not actually have execute permission information.

Ouch.

 Instead, it is emulated by looking at the file, and returning 0 if the
 file starts with, e.g., a COFF header or with '#!'.
 (The same heuristic is used when executing a script as well.)
 
 You can thus fix this by either creating actual scripts in above rules
 and the file creation below, or by removing the tests here.  I'm not
 sure which you prefer.

I'd prefer the former, to keep the coverage a little bigger on non-MinGW
systems.  Is that ok?

Regards,
   Stefano



Re: [PATCH] Test `$(var:suf=rpl)' expansion in special automake variables.

2010-12-18 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sat, Dec 18, 2010 at 10:35:43AM CET:
 On Saturday 18 December 2010, Ralf Wildenhues wrote:
   +# Try also with `:=', to ensure the parser is not unduly confused
   +# into thinking that it's an unportable assignement operator.
  
  This comment is bogus, right?  There is no such thing as ':=' within
  $(var:A=B),
 but there is in $(var:=x) (below this is $(t1:=.sh)).
 
  and the code below does not use := to assign variables.
 
 Indeed, and so we want to enssure the automake parser does not 
 (errenously) think we are trying to do so.
 
  What do you mean with this text?  Also try an empty match suffix.?
 
 Yes; maybe a comment like this would be better?
   
  # Also try an empty match suffix, to ensure that the `:=' in there is
  # not confused by the parser with an unportable assignement operator.

Yes, thanks.

  These 'test -x' commands fail on MinGW/MSYS because the file system does
  not actually have execute permission information.
 
 Ouch.
 
  Instead, it is emulated by looking at the file, and returning 0 if the
  file starts with, e.g., a COFF header or with '#!'.
  (The same heuristic is used when executing a script as well.)
  
  You can thus fix this by either creating actual scripts in above rules
  and the file creation below, or by removing the tests here.  I'm not
  sure which you prefer.
 
 I'd prefer the former, to keep the coverage a little bigger on non-MinGW
 systems.  Is that ok?

Yes, that's what I meant.

Thanks,
Ralf



Re: [PATCH] Test `$(var:suf=rpl)' expansion in special automake variables.

2010-12-17 Thread Ralf Wildenhues
Hello Stefano,

* Stefano Lattarini wrote on Thu, Dec 09, 2010 at 01:46:48PM CET:
 Test `$(var:suf=rpl)' expansion in special automake variables.
 
 * tests/posixsubst-data.test: New test.
[...]
 * tests/posixsubst-scripts.test: Likewise.

 --- /dev/null
 +++ b/tests/posixsubst-scripts.test
 @@ -0,0 +1,89 @@

 +# Test that POSIX variable expansion `$(var:str=rpl)' works when used
 +# with the SCRIPTS primary.

 +cat  configure.in  'END'
 +AC_OUTPUT
 +END
 +
 +cat  Makefile.am  'END'
 +t1 = foo1 foo2
 +t2 = bar1x bar2
 +t3 = quu-baz
 +
 +bar1 bar2 quux.pl:
 + :  $@
 +CLEANFILES = bar1 bar2 quux.pl
 +
 +# Try also with `:=', to ensure the parser is not unduly confused
 +# into thinking that it's an unportable assignement operator.

This comment is bogus, right?  There is no such thing as ':=' within
$(var:A=B), and the code below does not use := to assign variables.
What do you mean with this text?  Also try an empty match suffix.?
(Repetitious as it is, it the same text is in all the other tests of
this patch as well.)

 +dist_sbin_SCRIPTS = $(t1:=.sh)
 +libexec_SCRIPTS = $(t2:x=)
 +nodist_bin_SCRIPTS = $(t3:-baz=x.pl)
 +
 +check-local: test1 test2
 +.PHONY: test1 test2
 +test1:
 + ls -l
 + test -f bar1
 + test -f bar2
 + test -f quux.pl
 +test2: distdir
 + ls -l $(distdir)
 + ## the scripts foo1.sh and foo2.sh should be distributed
 + test -f $(distdir)/foo1.sh
 + test -f $(distdir)/foo2.sh
 + ## the scripts bar1, bar2 and quux.pl shouldn't be distributed
 + test ! -r $(distdir)/bar1
 + test ! -r $(distdir)/bar2
 + test ! -r $(distdir)/quux.pl
 +
 +installcheck-local:
 + ls -l $(prefix)/libexec $(prefix)/bin $(prefix)/sbin
 + test -f $(prefix)/sbin/foo1.sh
 + test -x $(prefix)/sbin/foo1.sh
 + test -f $(prefix)/sbin/foo2.sh
 + test -x $(prefix)/sbin/foo2.sh
 + test -f $(prefix)/libexec/bar1
 + test -x $(prefix)/libexec/bar1
 + test -f $(prefix)/libexec/bar2
 + test -x $(prefix)/libexec/bar2
 + test -f $(prefix)/bin/quux.pl
 + test -x $(prefix)/bin/quux.pl

These 'test -x' commands fail on MinGW/MSYS because the file system does
not actually have execute permission information.  Instead, it is
emulated by looking at the file, and returning 0 if the file starts
with, e.g., a COFF header or with '#!'.
(The same heuristic is used when executing a script as well.)

You can thus fix this by either creating actual scripts in above rules
and the file creation below, or by removing the tests here.  I'm not
sure which you prefer.

Thanks,
Ralf

 +END
 +
 +:  foo1.sh
 +:  foo2.sh
 +
 +$ACLOCAL
 +$AUTOCONF
 +$AUTOMAKE
 +
 +cwd=`pwd` || Exit 1
 +./configure --prefix=$cwd/_inst
 +$MAKE
 +$MAKE test1 test2
 +$MAKE install
 +$MAKE installcheck
 +$MAKE distcheck




Re: [PATCH] Test `$(var:suf=rpl)' expansion in special automake variables.

2010-12-09 Thread Stefano Lattarini
On Thursday 09 December 2010, Eric Blake wrote:
 On 12/09/2010 05:46 AM, Stefano Lattarini wrote:
  Another testsuite-enhancing patch, based off of maint and intended for
  master.
  
  Tested with Solaris 10 XPG4 make, Solaris 10 CCS make, Solaris 10 dmake,
  Heirloom make, GNU make from 3.79 up to 3.82, with the Debian ports of
  NetBSD make and FreeBSD make, with dash 0.5.2, bash 2.0, bash 4.1, pdksh,
  Solaris 10 /bin/sh and Heirloom shell.
  
  I'll wait the customary 72 hours (until sunday evening) before
  pushing.
 
 Can you also test whether $(var:$(var2)=$(var3)) works in all makes?

According to Ralf Wildenhues:
 http://www.mail-archive.com/autom...@gnu.org/msg16318.html
even $(var:=$(var2)) does not work portably.  I'm now going to check
the make implementations I've access to to see if any of them fails
with these constructs.  I will post the results shortly.

 That question was raised during today's Austin Group meeting, as part of
 figuring out how portable recursive variable expansion is in practice.
 

Regards,
  Stefano



Re: [PATCH] Test `$(var:suf=rpl)' expansion in special automake variables.

2010-12-09 Thread Eric Blake
On 12/09/2010 05:46 AM, Stefano Lattarini wrote:
 Another testsuite-enhancing patch, based off of maint and intended for
 master.
 
 Tested with Solaris 10 XPG4 make, Solaris 10 CCS make, Solaris 10 dmake,
 Heirloom make, GNU make from 3.79 up to 3.82, with the Debian ports of
 NetBSD make and FreeBSD make, with dash 0.5.2, bash 2.0, bash 4.1, pdksh,
 Solaris 10 /bin/sh and Heirloom shell.
 
 I'll wait the customary 72 hours (until sunday evening) before
 pushing.

Can you also test whether $(var:$(var2)=$(var3)) works in all makes?
That question was raised during today's Austin Group meeting, as part of
figuring out how portable recursive variable expansion is in practice.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature