jtreg unit/regression tests: Shell scripts under CYGWIN

Jonathan Gibbons Jonathan.Gibbons at Sun.COM
Sun Aug 2 07:25:42 PDT 2009


Max,

That would be up to the script authors, not jtreg. You can certainly  
write scripts
that include library files.  Some tests are written like that, but  
some folk also
regard it as good practice to keep a test self-contained whereever  
possible
and don't like reliance on a single shared external library file.

Many tests are already Cygwin-aware -- typically, it depends whether the
engineer responsible for the tests uses Cygwin.  It would arguably be
interesting to see what percentage of OpenJDK tests have already been
converted.

-- Jon


On Aug 2, 2009, at 1:28 AM, Max (Weijun) Wang wrote:

> Is it possible to pull out these common codes into a separate file  
> and include it in each script?
>
> Thanks
> Max
>
> On Aug 2, 2009, at 12:03 AM, Jonathan Gibbons wrote:
>
>>
>> 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