From: Stefano Lattarini Date: Sat, 18 Dec 2010 12:34:23 +0000 (+0100) Subject: Make test 'posixsubst-script' portable to MinGW/MSYS. X-Git-Tag: ng-0.5a~293^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d6cd2896c637a24a9c125ef81506d911c3087d4;p=thirdparty%2Fautomake.git Make test 'posixsubst-script' portable to MinGW/MSYS. * tests/posixsubst-script.test: Ensure that the generated dummy scripts really start with a shebang line, to work around a limitation of 'test -x' on MinGW/MSYS. Reported by Ralf Wildenhues. --- diff --git a/ChangeLog b/ChangeLog index 6a2734771..7803a0015 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2010-12-18 Stefano Lattarini + Make test 'posixsubst-script' portable to MinGW/MSYS. + * tests/posixsubst-script.test: Ensure that the generated dummy + scripts really start with a shebang line, to work around a + limitation of 'test -x' on MinGW/MSYS. + Reported by Ralf Wildenhues. + Improve comments in tests `posixsubst*.test'. * tests/posixsubst-data.test: Improve comment explaining why we try also empty match suffix. diff --git a/tests/posixsubst-scripts.test b/tests/posixsubst-scripts.test index d5fe91eb0..918bced79 100755 --- a/tests/posixsubst-scripts.test +++ b/tests/posixsubst-scripts.test @@ -25,13 +25,22 @@ cat >> configure.in << 'END' AC_OUTPUT END +# We have to be careful with 'test -x' commands on MinGW/MSYS, because +# the file system does not actually have execute permission information. +# Instead, that is emulated by looking at the file content, and returning +# 0 if the file starts with, e.g., a COFF header or with '#!'. +# So we need to create actual scripts in the make rules and in the file +# creation below. + cat > Makefile.am << 'END' t1 = foo1 foo2 t2 = bar1x bar2 t3 = quu-baz -bar1 bar2 quux.pl: - : > $@ +bar1 bar2: + (echo '#!/bin/sh' && echo 'exit 0') > $@ +quux.pl: + (echo '#!/bin/perl' && echo '1;') > $@ CLEANFILES = bar1 bar2 quux.pl # Also try an empty match suffix, to ensure that the `:=' in there is @@ -71,8 +80,11 @@ installcheck-local: test -x $(prefix)/bin/quux.pl END -: > foo1.sh -: > foo2.sh +cat > foo1.sh <<'END' +#!/bin/sh +exit 0 +END +cp foo1.sh foo2.sh $ACLOCAL $AUTOCONF