bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: testsuite portability nit


From: Paul Eggert
Subject: Re: testsuite portability nit
Date: Wed, 20 Apr 2005 17:34:11 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

Jim Meyering <address@hidden> writes:

> I wouldn't have objected to the original patch,

OK, then I installed the following, which I hope implements all the
spirit of the original patch (though it differs in some unimportant
details.

> there is precedent for using $BUILD_SRC_DIR.

It shouldn't be needed here, though, right?  The code is already using
$pwd/../../src for that purpose.

2005-04-20  Paul Eggert  <address@hidden>

        Port test cases to Microsoft-Windows-related environments,
        following suggestions from Eric Blake.
        * tests/install/Makefile.am (TESTS_ENVIRONMENT): Add EXEEXT.
        * tests/install/basic-1: Undo previous change.
        (dd, dd2): New vars, which use $EXEEXT.  All uses of dd and dd2 changed.
        * tests/install/trap: Undo previous change.
        (sig): New var.  Use it insted of "trap '' CHLD".
        Append $EXEEXT to executable name.

Index: tests/install/Makefile.am
===================================================================
RCS file: /fetish/cu/tests/install/Makefile.am,v
retrieving revision 1.7
diff -p -u -r1.7 Makefile.am
--- tests/install/Makefile.am   10 May 2004 15:13:45 -0000      1.7
+++ tests/install/Makefile.am   20 Apr 2005 23:44:58 -0000
@@ -4,4 +4,5 @@ AUTOMAKE_OPTIONS = 1.3 gnits
 TESTS = trap basic-1 create-leading
 EXTRA_DIST = $(TESTS)
 TESTS_ENVIRONMENT = \
+  EXEEXT='$(EXEEXT)' \
   PATH="`pwd`/../../src$(PATH_SEPARATOR)$$PATH"
Index: tests/install/basic-1
===================================================================
RCS file: /fetish/cu/tests/install/basic-1,v
retrieving revision 1.14
diff -p -u -r1.14 basic-1
--- tests/install/basic-1       18 Apr 2005 18:48:22 -0000      1.14
+++ tests/install/basic-1       20 Apr 2005 23:44:58 -0000
@@ -8,13 +8,6 @@ fi
 dir=dir
 file=file
 
-# Skip this test if we're on a non-POSIX platform where executables' names end
-# in .exe, or we have some other problem like that.
-cat ../../src/dd > /dev/null || {
-  echo >&2 "$0: ../../src/dd is not readable, so can't run this test"
-  exit 77
-}
-
 pwd=`pwd`
 tmp=inst-basic.$$
 trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
@@ -41,10 +34,12 @@ test -f $file || fail=1
 test -f $dir/$file || fail=1
 
 # Make sure strip works.
-cp ../../../src/dd .
-cp dd dd2
+dd=dd$EXEEXT
+dd2=dd2$EXEEXT
+cp ../../../src/$dd . || fail=1
+cp $dd $dd2 || fail=1
 
-strip dd2 || \
+strip $dd2 || \
   {
     cat 1>&2 <<EOF
 $0: WARNING!!!
@@ -56,12 +51,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 $dir || fail=1
 # Make sure the source file is still around.
-test -f dd || fail=1
+test -f $dd || fail=1
 
 # Make sure that the destination file has the requested permissions.
-set X `ls -l $dir/dd`
+set X `ls -l $dir/$dd`
 shift
 test "$1" = -r-xr-xr-x || fail=1
 
Index: tests/install/trap
===================================================================
RCS file: /fetish/cu/tests/install/trap,v
retrieving revision 1.2
diff -p -u -r1.2 trap
--- tests/install/trap  18 Apr 2005 06:35:22 -0000      1.2
+++ tests/install/trap  20 Apr 2005 23:44:58 -0000
@@ -7,12 +7,6 @@ if test "$VERBOSE" = yes; then
   ginstall --version
 fi
 
-(trap '' CHLD) || {
-  echo >&2 "$0: the shell command \"trap '' CHLD\" does not work," \
-    "so can't run this test"
-  exit 77
-}
-
 pwd=`pwd`
 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
@@ -29,8 +23,10 @@ fi
 
 fail=0
 
+# ash doesn't support "trap '' CHLD"; it knows only signal numbers.
+sig=`$pwd/../../src/kill -l CHLD 2>/dev/null` && trap '' $sig
+
 # Before 2004-04-21, install would infloop, in the `while (wait...' loop:
-trap '' CHLD
-ginstall -s $pwd/../../src/ginstall .
+ginstall -s $pwd/../../src/ginstall$EXEEXT .
 
 (exit $fail); exit $fail




reply via email to

[Prev in Thread] Current Thread [Next in Thread]