Need reviewer - fixing tests to work with CYGWIN

Kelly O'Hair Kelly.Ohair at Sun.COM
Wed Dec 23 10:03:17 PST 2009


Nicolay Haustov wrote:
> Kelly,
> 
> The changes look fine.

Thanks. Unfortunately I need an openjdk name to put in the Changeset
comment.


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

All that you say below is true, and unification and guidelines on variable
names would be great. But trying to keep it that way is another story.
I have tried to create the least disturbance to the style of these tests,
micro surgery fixes for the time being. To spend 10X longer on the problem
just doesn't make sense to me at this time, too many other eggs to crack. ;^)

Also, I feel that some of these tests could probably be re-written
in java and avoid the shell completely, but again, no time right now.

I appreciate the review and observations.

-kto

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