[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
testsuite portability nit
From: |
Eric Blake |
Subject: |
testsuite portability nit |
Date: |
Sat, 16 Apr 2005 16:35:39 -0600 |
User-agent: |
Mozilla Thunderbird 1.0.2 (Windows/20050317) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On cygwin, where /bin/sh is ash, "trap '' CHLD" doesn't work (ash only
accepts signal numbers, not names):
$ trap '' CHLD
trap: bad signal CHLD
But CHLD is not one of the portable signal numbers (it is 20 on cygwin,
but other numbers on other platforms). Not all versions of kill(1) can
convert names to numbers, but this is coreutils.
Furthermore, install needs to use $EXEEXT on arguments.
2005-04-16 Eric Blake <address@hidden>
* tests/install/Makefile.am (TESTS_ENVIRONMENT): Propagate
BUILD_SRC_DIR and EXEEXT to tests.
* tests/install/basic-1: Use EXEEXT.
* tests/install/trap: trap '' CHLD is not portable on
Cygwin. Also, use EXEEXT.
- --
Life is short - so eat dessert first!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCYZM784KuGfSFAYARAvu1AJ4u2qNQIlvTiVMz3OYnS/QeomZhYACfUoWe
DyToYY44Z2r+NZeKCoXNUr4=
=/O1E
-----END PGP SIGNATURE-----
Index: tests/install/Makefile.am
===================================================================
RCS file: /cvsroot/coreutils/coreutils/tests/install/Makefile.am,v
retrieving revision 1.7
diff -u -p -r1.7 Makefile.am
--- tests/install/Makefile.am 10 May 2004 15:13:45 -0000 1.7
+++ tests/install/Makefile.am 16 Apr 2005 22:33:13 -0000
@@ -4,4 +4,6 @@ AUTOMAKE_OPTIONS = 1.3 gnits
TESTS = trap basic-1 create-leading
EXTRA_DIST = $(TESTS)
TESTS_ENVIRONMENT = \
- PATH="`pwd`/../../src$(PATH_SEPARATOR)$$PATH"
+ PATH="`pwd`/../../src$(PATH_SEPARATOR)$$PATH" \
+ EXEEXT=$(EXEEXT) \
+ BUILD_SRC_DIR="`pwd`/../../src"
Index: tests/install/Makefile.in
===================================================================
RCS file: /cvsroot/coreutils/coreutils/tests/install/Makefile.in,v
retrieving revision 1.139
diff -u -p -r1.139 Makefile.in
Index: tests/install/basic-1
===================================================================
RCS file: /cvsroot/coreutils/coreutils/tests/install/basic-1,v
retrieving revision 1.11
diff -u -p -r1.11 basic-1
--- tests/install/basic-1 11 Aug 2004 23:41:59 -0000 1.11
+++ tests/install/basic-1 16 Apr 2005 22:33:13 -0000
@@ -34,10 +34,10 @@ test -f $file || fail=1
test -f $dir/$file || fail=1
# Make sure strip works.
-cp ../../../src/dd .
-cp dd dd2
+cp ../../../src/dd${EXEEXT} .
+cp dd${EXEEXT} dd2${EXEEXT}
-strip dd2 || \
+strip dd2${EXEEXT} || \
{
cat 1>&2 <<EOF
$0: WARNING!!!
@@ -49,12 +49,12 @@ EOF
# This test would fail with 3.16s when using versions of strip that
# don't work on read-only files (the one from binutils works fine).
-ginstall -s -c -m 555 dd $dir || fail=1
+ginstall -s -c -m 555 dd${EXEEXT} $dir || fail=1
# Make sure the source file is still around.
-test -f dd || fail=1
+test -f dd${EXEEXT} || fail=1
# Make sure that the destination file has the requested permissions.
-set X `ls -l $dir/dd`
+set X `ls -l $dir/dd${EXEEXT}`
shift
test "$1" = -r-xr-xr-x || fail=1
Index: tests/install/trap
===================================================================
RCS file: /cvsroot/coreutils/coreutils/tests/install/trap,v
retrieving revision 1.1
diff -u -p -r1.1 trap
--- tests/install/trap 10 May 2004 15:13:29 -0000 1.1
+++ tests/install/trap 16 Apr 2005 22:33:13 -0000
@@ -24,7 +24,8 @@ fi
fail=0
# Before 2004-04-21, install would infloop, in the `while (wait...' loop:
-trap '' CHLD
-ginstall -s $pwd/../../src/ginstall .
+# neither "trap '' CHLD" nor "trap '' `kill -l CHLD`" is portable
+trap '' `${BUILD_SRC_DIR?}/kill -l CHLD`
+ginstall -s $pwd/../../src/ginstall${EXEEXT} .
(exit $fail); exit $fail
- testsuite portability nit,
Eric Blake <=