Need reviewer - fixing tests to work with CYGWIN

Nicolay Haustov Nicolay.Haustov at Sun.COM
Wed Dec 23 02:27:37 PST 2009


Kelly,

The changes look fine.

It would be great if you could take this opportunity to unify platform 
setup and other common tasks in shell tests.

There is lots of duplicate code dealing with it in each test. It would 
be good if all of it was moved to common script. Then each test can 
import it and use necessary functions (see example below). It would also 
remove lots of code and make adding common setup or porting to new 
platform much easier if need arises.

In addition, some tests use PS and some PATHSEP, same with FS and 
FILESEP. Some unification and guidelines are needed here.

Note that there are already tests that attempt use common framework 
(e.g. see test/sun/tools/common/CommonSetup.sh, 
sun/jvmstat/testlibrary/utils.sh).

Am I dreaming here? :)


In common/common.sh:

set_platform() {
# Set platform specific variables
OS=`uname -s`
case "$OS" in
    SunOS|Linux)
      PS=":"
      FS="/"
      DIFF="diff"
      SANITIZE_STR="cat"
      ;;
    Windows* | CYGWIN* )
      PS=";"
      FS="\\"
      DIFF="diff -w"
      SANITIZE_STR="sed -e 's/@\\r@@g'"
      ;;
    *)
     echo "Unrecognized system: $OS"
     exit 1;
     ;;
esac
}

And then in test script

. "$TESTSRC/../../common/common.sh"

set_platform

.... or

$DIFF ....

... or

CLASS_NAME=`"$JAVA" UnicodeTest " | $SANITIZE_STR`

Thanks

Kelly O'Hair wrote:
> Need reviewer - fixing tests to work with CYGWIN
> 
> No hurry on this. I think it's final, but need to run the tests
> a few times with both MKS and cygwin, and on all platforms to verify
> I haven't broken anything.
> 
> 6910834: TEST: java/io/File/Basic.java fails on Windows CYGWIN environment
> 6910835: TESTS: 3 java/io run.sh tests fail when run on Windows XP CYGWIN
> 6911104: Tests do not work with CYGWIN: tools, sun/tools, and com/sun/tools
> 6911108: These tests do not work with CYGWIN: java/util
> 6911112: Tests do not work with CYGWIN: javax/imageio/, javax/script/, 
> and sun/misc/
> 6911113: These tests do not work with CYGWIN: java/nio
> 6911117: These tests do not work with CYGWIN: com/sun/jdi
> 6911129: These tests do not work with CYGWIN: java/lang
> 6911131: Test does not work with CYGWIN: 
> sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh
> 
> http://cr.openjdk.java.net/~ohair/openjdk7/jdk7-tl-tests/webrev/
> 
> -kto


More information about the serviceability-dev mailing list