jtreg unit/regression tests: Shell scripts under CYGWIN

Jonathan Gibbons Jonathan.Gibbons at Sun.COM
Sat Aug 1 09:03:08 PDT 2009


On Aug 1, 2009, at 8:03 AM, Joseph D. Darcy wrote:

> Brad Wetmore wrote:
>>
>> I know I'm approaching "Holy War" territory, but developers are  
>> starting to use Cygwin instead of MKS for their windows build  
>> environments.
>>
>> Many of our existing test shell scripts contain the following  
>> pattern:
>>
>> OS=`uname -s`
>> case "$OS" in
>>  SunOS | Linux )
>>    NULL=/dev/null
>>    PS=":"
>>    FS="/"
>>    TMP=/tmp
>>    ;;
>>  Windows_* )
>>    NULL=NUL
>>    PS=";"
>>    FS="\\"
>>    TMP="c:/temp"
>>    ;;
>>  * )
>>    echo "Unrecognized operating system!"
>>    exit 1;
>>    ;;
>> esac
>>
>> This will fail on CYGWIN, as `uname -s` returns "CYGWIN_NT-5.1".   
>> The fix is to update the Windows_* line to include CYGWIN:
>>
>>  Windows_* | CYGWIN* )
>>
>> Please do this when writing new tests or updating existing ones.
>
> And it would be a fine little project if someone wanted to add the  
> Cygwin support proactively to all the shell regression tests!

I should mention the alternative possibility that it may be possible  
to convert some shell tests to Java programs. This technique is  
routinely used in the langtools repository, where we have managed to  
eliminate a many/most of the shell tests.


>
>
> -Joe




More information about the jdk7-dev mailing list