bug-coreutils
[Top][All Lists]
Advanced

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

Re: testsuite portability nit


From: Eric Blake
Subject: Re: testsuite portability nit
Date: Mon, 18 Apr 2005 07:04:55 -0600
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Paul Eggert on 4/18/2005 12:39 AM:
> I installed the following patch, in the hopes that it'd be relatively
> simple and easy to maintain.  It skip the tests on the platforms with
> the contrary-to-POSIX glitches.
> 
> 2005-04-17  Paul Eggert  <address@hidden>
> 
>       Work around a couple of "make check" failures reported for Cygwin
>       and ash by Eric Blake.
>       * tests/install/basic-1: Skip this test if ../../src/dd isn't readable.
>       * tests/install/trap: Skip this test if "trap '' CHLD" doesn't work.

What was wrong with my proposed patch?  It made both of these tests PASS
instead of SKIP on cygwin, always a good goal in testsuite coverage.  And
my patch to tests/install/trap was shorter than your patch to skip it, so
I argue that it was simple and easy enough to maintain.

Furthermore, your patch to tests/install/basic-1 does not solve the
problem: `test -r ../../src/dd' succeeds on cygwin because of .exe magic
built in to cygwin stat(2); the failure comes later when open(2) fails
after the stat(2) succeeded because the filename is missing the extension
(in cp(1) if I have not applied my cygwin .exe patches to cp yet,
otherwise in strip(1) called by ginstall).  Propagating $EXEEXT to the
testsuite completely works around half-baked .exe magic in cygwin by
explicitly specifying it up front instead of relying on cygwin magic to
determine when it is needed.


Under your patch:

$ make -C tests/install check TESTS=basic-1 VERBOSE=yes
make: Entering directory `/home/eblake/coreutils/tests/install'
make  check-TESTS
make[1]: Entering directory `/home/eblake/coreutils/tests/install'
+ ginstall --version
install (GNU coreutils) 5.3.1
Written by David MacKenzie.

Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ dir=dir
+ file=file
+ test -r ../../src/dd
+ pwd
+ pwd=/home/eblake/coreutils/tests/install
+ tmp=inst-basic.3840
+ trap status=$?; cd $pwd; rm -rf $tmp && exit $status 0
+ trap exit $? 1 2 13 15
+ framework_failure=0
+ mkdir inst-basic.3840
+ cd inst-basic.3840
+ rm -rf dir file
+ mkdir -p dir
+ echo foo
+ test 0 = 1
+ fail=0
+ ginstall file dir
+ test -f file
+ test -f dir/file
+ cp ../../../src/dd .
cp: cannot open `../../../src/dd' for reading: No such file or directory
+ cp dd dd2
cp: cannot stat `dd': No such file or directory
+ strip dd2
strip: 'dd2': No such file
+ ginstall -s -c -m 555 dd dir
ginstall: cannot stat `dd': No such file or directory
+ fail=1
+ test -f dd
+ fail=1
+ ls -l dir/dd
ls: dir/dd: No such file or directory
+ set X
+ shift
+ test  = -r-xr-xr-x
+ fail=1
+ ginstall -d .
+ ginstall -d newdir
+ ginstall -d newdir1 newdir2 newdir3
+ exit 1
+ exit 1
+ status=1
+ cd /home/eblake/coreutils/tests/install
+ rm -rf inst-basic.3840
+ exit 1
FAIL: basic-1
======================================
1 of 1 tests failed
Please report to address@hidden
======================================
make[1]: *** [check-TESTS] Error 1
make[1]: Leaving directory `/home/eblake/coreutils/tests/install'
make: *** [check-am] Error 2
make: Leaving directory `/home/eblake/coreutils/tests/install'


Under my patch:

$ make -C tests/install check TESTS=basic-1 VERBOSE=yes
make: Entering directory `/home/eblake/coreutils/tests/install'
make  check-TESTS
make[1]: Entering directory `/home/eblake/coreutils/tests/install'
+ ginstall --version
install (GNU coreutils) 5.3.1
Written by David MacKenzie.

Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ dir=dir
+ file=file
+ test -r ../../src/dd
+ pwd
+ pwd=/home/eblake/coreutils/tests/install
+ tmp=inst-basic.2796
+ trap status=$?; cd $pwd; rm -rf $tmp && exit $status 0
+ trap exit $? 1 2 13 15
+ framework_failure=0
+ mkdir inst-basic.2796
+ cd inst-basic.2796
+ rm -rf dir file
+ mkdir -p dir
+ echo foo
+ test 0 = 1
+ fail=0
+ ginstall file dir
+ test -f file
+ test -f dir/file
+ cp ../../../src/dd.exe .
+ cp dd.exe dd2.exe
+ strip dd2.exe
+ ginstall -s -c -m 555 dd.exe dir
+ test -f dd.exe
+ ls -l dir/dd.exe
+ set X -r-xr-xr-x 1 eblake None 39424 Apr 18 06:55 dir/dd.exe
+ shift
+ test -r-xr-xr-x = -r-xr-xr-x
+ ginstall -d .
+ ginstall -d newdir
+ ginstall -d newdir1 newdir2 newdir3
+ exit 0
+ exit 0
+ status=0
+ cd /home/eblake/coreutils/tests/install
+ rm -rf inst-basic.2796
+ exit 0
PASS: basic-1
==================
All 1 tests passed
==================
make[1]: Leaving directory `/home/eblake/coreutils/tests/install'
make: Leaving directory `/home/eblake/coreutils/tests/install'


- --
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

iD8DBQFCY7B384KuGfSFAYARAi55AKDLLDgWvEiNksRYMAM9NdwNtCC1hQCgkn7a
u/PitnMTpilLLonIkqpQ4No=
=GeE6
-----END PGP SIGNATURE-----




reply via email to

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