Merge
authorohair
Tue, 05 Jan 2010 13:44:09 -0800
changeset 4664 0b0443cbc448
parent 4663 dfea6ffdb0dc (diff)
parent 4534 791203c47f4e (current diff)
child 4665 d14dc3d9e1fa
Merge
--- a/jdk/test/com/sun/jdi/ProcessAttachTest.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/com/sun/jdi/ProcessAttachTest.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -54,10 +54,14 @@
 OS=`uname -s`
 
 case "$OS" in
-  Windows* | CYGWIN_NT*)
+  Windows*)
     PS=";"
     OS="Windows"
     ;;
+  CYGWIN*)
+    PS=";"
+    OS="CYGWIN"
+    ;;
   * )
     PS=":"
     ;;
@@ -67,16 +71,23 @@
 {
   OUTPUTFILE=${TESTCLASSES}/Debuggee.out
   ${JAVA} "$@" > ${OUTPUTFILE} &
-  pid="$!"
+  startpid="$!"
+  pid="${startpid}"
                                                                                                      
+  # CYGWIN startpid is not the native windows PID we want, get the WINPID
+  if [ "${OS}" = "CYGWIN" ]; then
+    sleep 2
+    ps -l -p ${startpid}
+    pid=`ps -l -p ${startpid} | tail -1 | awk '{print $4;}'`
+  fi
+  
   # MKS creates an intermediate shell to launch ${JAVA} so
-  # ${pid} is not the actual pid. We have put in a small sleep
+  # ${startpid} is not the actual pid. We have put in a small sleep
   # to give the intermediate shell process time to launch the
   # "java" process.
   if [ "$OS" = "Windows" ]; then
     sleep 2
-    realpid=`ps -o pid,ppid,comm|grep ${pid}|grep "java"|cut -c1-6`
-    pid=${realpid}
+    pid=`ps -o pid,ppid,comm|grep ${startpid}|grep "java"|cut -c1-6`
   fi
                                                                                                      
   echo "Waiting for Debuggee to initialize..."
@@ -91,7 +102,7 @@
     echo "Waiting $attempts second(s) ..."
   done
 
-  echo "Debuggee is process $pid"
+  echo "Debuggee is process $pid (startpid=${startpid})"
 }
 
 stopDebuggee()
@@ -100,7 +111,7 @@
   if [ $? != 0 ] ; then
     echo "Error: ShutdownDebuggee failed"
     failures=`expr $failures + 1`
-    kill -9 $pid
+    kill -9 ${startpid}
   fi
 }
 
@@ -123,7 +134,7 @@
   -agentlib:jdwp=transport=dt_socket,server=y,suspend=n \
   -classpath "${TESTCLASSES}" ProcessAttachDebuggee "${PORTFILE}"
 
-$JAVA -classpath ${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar \
+$JAVA -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
   ProcessAttachDebugger $pid 2>&1
 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 
@@ -141,7 +152,7 @@
   -agentlib:jdwp=transport=dt_socket,server=y,suspend=y \
   -classpath "${TESTCLASSES}" ProcessAttachDebuggee "${PORTFILE}"
 
-$JAVA -classpath ${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar \
+$JAVA -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
   ProcessAttachDebugger $pid 2>&1
 
 # The debuggee is suspended and doesn't run until the debugger
--- a/jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -51,7 +51,7 @@
   Linux )
     PS=":"
     ;;
-  Windows* )
+  Windows* | CYGWIN*)
     PS=";"
     ;;
   * )
@@ -71,7 +71,7 @@
 $JAVAC -d "${TESTCLASSES}" "${TESTSRC}"/JdiLoadedByCustomLoader.java
 
 mkdir "${SOMEOTHERDIR}"
-$JAVAC -d "${SOMEOTHERDIR}" -classpath ${TESTSRC}${PS}${TESTJAVA}/lib/tools.jar \
+$JAVAC -d "${SOMEOTHERDIR}" -classpath "${TESTSRC}${PS}${TESTJAVA}/lib/tools.jar" \
     "${TESTSRC}"/ListConnectors.java
 
 # Run the test 
--- a/jdk/test/com/sun/tools/attach/ApplicationSetup.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/com/sun/tools/attach/ApplicationSetup.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -49,7 +49,11 @@
   # "java" process.
   if [ "$OS" = "Windows" ]; then
     sleep 2
-    realpid=`ps -o pid,ppid,comm|grep ${pid}|grep "java"|cut -c1-6`
+    if [ "${isCygwin}" = "true" ] ; then
+      realpid=`ps -p ${pid} | tail -1 | awk '{print $4;}'`
+    else
+      realpid=`ps -o pid,ppid,comm|grep ${pid}|grep "java"|cut -c1-6`
+    fi
     pid=${realpid}
   fi
                                                                                                                   
@@ -57,7 +61,7 @@
   attempts=0
   while true; do
     sleep 1
-    port=`tail -1 ${OUTPUTFILE}`
+    port=`tail -1 ${OUTPUTFILE} | sed -e 's@\\r@@g' `
     if [ ! -z "$port" ]; then
       # In case of errors wait time for output to be flushed
       sleep 1
--- a/jdk/test/com/sun/tools/attach/BasicTests.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/com/sun/tools/attach/BasicTests.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -48,7 +48,7 @@
 
 echo "Running tests ..."
 
-$JAVA -classpath ${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar \
+$JAVA -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
   BasicTests $pid $agent $badagent $redefineagent 2>&1
 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 
--- a/jdk/test/com/sun/tools/attach/CommonSetup.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/com/sun/tools/attach/CommonSetup.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -49,6 +49,12 @@
     OS="Windows"
     FS="\\"
     ;;
+  CYGWIN* )
+    PS=";"
+    OS="Windows"
+    FS="\\"
+    isCygwin=true
+    ;;
   * )
     echo "Unrecognized system!"
     exit 1;
--- a/jdk/test/com/sun/tools/attach/PermissionTests.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/com/sun/tools/attach/PermissionTests.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -48,7 +48,7 @@
 
 echo "Deny test"
 # deny 
-$JAVA -classpath ${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar \
+$JAVA -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
     -Djava.security.manager \
     -Djava.security.policy=${TESTSRC}/java.policy.deny \
     PermissionTest $pid true 2>&1
@@ -56,7 +56,7 @@
 
 # allow
 echo "Allow test"
-$JAVA -classpath ${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar \
+$JAVA -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
     -Djava.security.manager \
     -Djava.security.policy=${TESTSRC}/java.policy.allow \
     PermissionTest $pid false 2>&1 
--- a/jdk/test/com/sun/tools/attach/ProviderTests.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/com/sun/tools/attach/ProviderTests.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -46,6 +46,6 @@
 echo "Running test ..."
 
 $JAVA -classpath \
-  ${TESTCLASSES}${PS}${TESTCLASSES}/SimpleProvider.jar${PS}${TESTJAVA}/lib/tools.jar \
+  "${TESTCLASSES}${PS}${TESTCLASSES}/SimpleProvider.jar${PS}${TESTJAVA}/lib/tools.jar" \
   ProviderTest
 
--- a/jdk/test/java/beans/Introspector/Test5102804.java	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/java/beans/Introspector/Test5102804.java	Tue Jan 05 13:44:09 2010 -0800
@@ -24,6 +24,7 @@
 /*
  * @test
  * @bug 5102804
+ * @ignore This test is not predictable with regards to GC
  * @summary Tests memory leak
  * @author Sergey Malenkov
  */
--- a/jdk/test/java/io/File/Basic.java	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/java/io/File/Basic.java	Tue Jan 05 13:44:09 2010 -0800
@@ -75,7 +75,7 @@
         if (!f.canRead()) fail(f, "is not readable");
         if (f.canWrite() != writeable)
             fail(f, writeable ? "is not writeable" : "is writeable");
-        int rwLen = (File.separatorChar == '/' ? 6 : 7);
+        int rwLen = 6;
         if (f.length() != length) fail(f, "has wrong length");
     }
 
@@ -89,7 +89,7 @@
         if (nonExistantFile.exists()) fail(nonExistantFile, "exists");
 
         show(rwFile);
-        testFile(rwFile, true, File.separatorChar == '/' ? 6 : 7);
+        testFile(rwFile, true, 6);
         rwFile.delete();
         if (rwFile.exists())
             fail(rwFile, "could not delete");
--- a/jdk/test/java/io/File/basic.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/java/io/File/basic.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -32,10 +32,10 @@
 
 rm -rf x.Basic.*
 rm -f x.Basic.non
-echo xyzzy > x.Basic.rw
+printf "%s" "xyzzyN" > x.Basic.rw
 touch x.Basic.ro; chmod ugo-w x.Basic.ro
 mkdir x.Basic.dir
-if $TESTJAVA/bin/java $* -classpath $TESTCLASSES Basic; then
+if $TESTJAVA/bin/java $* -classpath "$TESTCLASSES" Basic; then
   [ -f x.Basic.rw ] && (echo "x.Basic.rw not deleted"; exit 1)
   ([ -d x.Basic.dir ] || [ \! -d x.Basic.dir2 ]) \
     && (echo "x.Basic.dir not renamed"; exit 1)
--- a/jdk/test/java/io/Serializable/evolution/RenamePackage/run.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/java/io/Serializable/evolution/RenamePackage/run.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -43,7 +43,7 @@
 case "$OS" in
 SunOS | Linux )
   PS=":"  ;;
-Windows* )
+Windows* | CYGWIN* )
   PS=";"  ;;
 * )
   echo "Unrecognized system!"
@@ -85,14 +85,14 @@
 ${JAVAC} -d ${TESTCLASSES}/nclasses ${TESTSRC}/install/SerialDriver.java
 
 # Run Case 1. Map test.SerialDriver within stream to install.SerialDriver.
-CLASSPATH=${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share; export CLASSPATH;
+CLASSPATH="${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
 ${JAVA} test.SerialDriver -s
-CLASSPATH=${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share; export CLASSPATH;
+CLASSPATH="${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
 ${JAVA} install.SerialDriver -d
 rm stream.ser
 
 # Run Case 2. Map install.SerialDriver within stream to test.SerialDriver.
-CLASSPATH=${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share; export CLASSPATH;
+CLASSPATH="${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
 ${JAVA} install.SerialDriver -s
-CLASSPATH=${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share; export CLASSPATH;
+CLASSPATH="${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
 ${JAVA} test.SerialDriver -d
--- a/jdk/test/java/io/Serializable/serialver/classpath/run.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/java/io/Serializable/serialver/classpath/run.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -49,7 +49,7 @@
 case "$OS" in
   SunOS | Linux )
     PS=":"    ;;
-  Windows* )
+  Windows* | CYGWIN* )
     PS=";"    ;;
   * )
     echo "Unrecognized system!"
--- a/jdk/test/java/io/Serializable/serialver/nested/run.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/java/io/Serializable/serialver/nested/run.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -49,7 +49,7 @@
 case "$OS" in
   SunOS | Linux )
     PS=":"    ;;
-  Windows* )
+  Windows* | CYGWIN* )
     PS=";"    ;;
   * )
     echo "Unrecognized system!"
--- a/jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -55,7 +55,7 @@
   Linux )
     FS="/"
     ;;
-  Windows* )
+  Windows* | CYGWIN* )
     FS="\\"
     ;;
 esac
--- a/jdk/test/java/lang/StringCoding/CheckEncodings.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/java/lang/StringCoding/CheckEncodings.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -31,7 +31,7 @@
 OS=`uname -s`
 case "$OS" in
   SunOS | Linux ) ;;
-  Windows* )
+  Windows* | CYGWIN* )
     echo "Passed"; exit 0 ;;
   * ) echo "Unrecognized system!" ;  exit 1 ;;
 esac
--- a/jdk/test/java/lang/System/finalization/FinExit.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/java/lang/System/finalization/FinExit.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -24,7 +24,9 @@
 #
 
 #
-x=`$TESTJAVA/bin/java -cp $TESTCLASSES FinExit`
+
+# We only want the first character, Windows might add CRLF
+x=`$TESTJAVA/bin/java -cp "$TESTCLASSES" FinExit | cut -c1`
 echo $x
 if [ "x$x" != "x1" ]; then
   echo On-exit finalizer invoked twice
--- a/jdk/test/java/lang/annotation/loaderLeak/LoaderLeak.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/java/lang/annotation/loaderLeak/LoaderLeak.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -49,6 +49,11 @@
     PS=":"
     FS="/"
     ;;
+  CYGWIN* )
+    NULL=/dev/null
+    PS=";"
+    FS="/"
+    ;;
   Windows* )
     NULL=NUL
     PS=";"
--- a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -43,11 +43,17 @@
     PS=":"
     FS="/"
     ;;
-  Windows* | CYGWIN*)
+  Windows*)
     PS=";"
     OS="Windows"
     FS="\\"
     ;;
+  CYGWIN*)
+    PS=";"
+    OS="Windows"
+    FS="\\"
+    isCygwin=true
+    ;;
   * )
     echo "Unrecognized system!"
     exit 1;
--- a/jdk/test/java/nio/channels/Selector/lots_of_updates.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/java/nio/channels/Selector/lots_of_updates.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -30,7 +30,7 @@
 
 OS=`uname -s`
 case "$OS" in
-    Windows_* )
+    Windows_* | CYGWIN* )
         echo "ulimit not on Windows"
         exit 0
         ;;
--- a/jdk/test/java/nio/channels/spi/AsynchronousChannelProvider/custom_provider.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/java/nio/channels/spi/AsynchronousChannelProvider/custom_provider.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -38,7 +38,7 @@
 
 OS=`uname -s`
 case "$OS" in
-    Windows_* )
+    Windows_* | CYGWIN* )
         CLASSPATH="${TESTCLASSES};${TESTSRC}"
         ;;
     * )
--- a/jdk/test/java/nio/file/Files/walk_file_tree.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/java/nio/file/Files/walk_file_tree.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -39,7 +39,7 @@
 
 OS=`uname -s`
 case "$OS" in
-    Windows_* )
+    Windows_* | CYGWIN* )
         echo "This test does not run on Windows" 
         exit 0
         ;;
--- a/jdk/test/java/nio/file/Path/delete_on_close.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/java/nio/file/Path/delete_on_close.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -40,7 +40,7 @@
 
 OS=`uname -s`
 case "$OS" in
-    Windows_* )
+    Windows_* | CYGWIN* )
         CLASSPATH="${TESTCLASSES};${TESTSRC}"
         ;;
     * )
--- a/jdk/test/java/util/Currency/PropertiesTest.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/java/util/Currency/PropertiesTest.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -34,7 +34,7 @@
     PS=":"
     FS="/"
     ;;
-  Windows* )
+  Windows* | CYGWIN* )
     PS=";"
     FS="\\"
     ;;
--- a/jdk/test/java/util/PluggableLocale/ExecTest.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/java/util/PluggableLocale/ExecTest.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -62,7 +62,7 @@
     PS=":"
     FS="/"
     ;;
-  Windows* )
+  Windows* | CYGWIN* )
     PS=";"
     FS="\\"
     ;;
--- a/jdk/test/java/util/ResourceBundle/Bug6299235Test.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/java/util/ResourceBundle/Bug6299235Test.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -35,7 +35,7 @@
     PATHSEP=":"
     FILESEP="/"
     ;;
-  Windows* )
+  Windows* | CYGWIN* )
     PATHSEP=";"
     FILESEP="\\"
     ;;
@@ -63,7 +63,7 @@
 fi
 
 if [ -d "${JRE_EXT_DIR}" ]; then
-    NEW_EXT_DIR=${JRE_EXT_DIR}${PATHSEP}${TESTSRC}
+    NEW_EXT_DIR="${JRE_EXT_DIR}${PATHSEP}${TESTSRC}"
 else
     NEW_EXT_DIR=${TESTSRC}
 fi
--- a/jdk/test/java/util/ResourceBundle/Control/ExpirationTest.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/java/util/ResourceBundle/Control/ExpirationTest.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -69,7 +69,7 @@
 HAS_S=NO
 
 case "`uname`" in
-Windows*)
+Windows* | CYGWIN* )
     DEL=";"
     ;;
 SunOS)
--- a/jdk/test/java/util/ServiceLoader/basic.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/java/util/ServiceLoader/basic.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -50,9 +50,9 @@
       SEP='\;' ;;
 esac
 
-JARD=`pwd`/x.jar
-EXTD=`pwd`/x.ext
-TESTD=`pwd`/x.test
+JARD=x.jar
+EXTD=x.ext
+TESTD=x.test
 
 if [ \! -d $EXTD ]; then
     # Initialize
--- a/jdk/test/javax/imageio/stream/StreamCloserLeak/run_test.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/javax/imageio/stream/StreamCloserLeak/run_test.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -92,7 +92,7 @@
       TMP="/tmp"
       ;;
 
-   Windows_95 | Windows_98 | Windows_NT | Windows_ME )
+   Windows_95 | Windows_98 | Windows_NT | Windows_ME | CYGWIN* )
       VAR="A different value for Win32"
       DEFAULT_JDK=/usr/local/java/jdk1.2/win32
       FILESEP="\\"
--- a/jdk/test/javax/script/CommonSetup.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/javax/script/CommonSetup.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -49,6 +49,12 @@
     OS="Windows"
     FS="\\"
     ;;
+  CYGWIN* )
+    PS=";"
+    OS="Windows"
+    FS="\\"
+    isCygwin=true
+    ;;
   * )
     echo "Unrecognized system!"
     exit 1;
--- a/jdk/test/javax/script/ProviderTest.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/javax/script/ProviderTest.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -46,5 +46,5 @@
 echo "Running test ..."
 
 $JAVA -classpath \
-  ${TESTCLASSES}${PS}${TESTCLASSES}/dummy.jar \
+  "${TESTCLASSES}${PS}${TESTCLASSES}/dummy.jar" \
   ProviderTest
--- a/jdk/test/sun/jvmstat/testlibrary/utils.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/sun/jvmstat/testlibrary/utils.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -40,7 +40,7 @@
 
     OS=`uname -s`
     case ${OS} in
-    Windows_*)
+    Windows_* | CYGWIN*)
         PS=";"
         FS="\\"
         ;;
@@ -54,7 +54,7 @@
 verify_os() {
     OS=`uname -s`
     case ${OS} in
-    Windows_95 | Windows_98 | Windows_ME)
+    Windows_95 | Windows_98 | Windows_ME | CYGWIN* )
         echo "Test bypassed: jvmstat feature not supported on ${OS}"
         exit 0
         ;;
--- a/jdk/test/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -45,7 +45,7 @@
 s^@TEST-SRC@/^${TESTCLASSES}${DFILESEP}^g
 EOF
     ;;
-Windows_95 | Windows_98 | Windows_NT | Windows_ME)
+Windows_95 | Windows_98 | Windows_NT | Windows_ME | CYGWIN*)
     PATHSEP=";"
     FILESEP="\\"
     DFILESEP=$FILESEP$FILESEP
--- a/jdk/test/sun/misc/URLClassPath/ClassnameCharTest.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/sun/misc/URLClassPath/ClassnameCharTest.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -44,7 +44,7 @@
     PS=":"
     FS="/"
     ;;
-  Windows* )
+  Windows* | CYGWIN* )
     PS=";"
     FS="\\"
     ;;
@@ -59,6 +59,6 @@
 ${TESTJAVA}${FS}bin${FS}jar xvf testclasses.jar "fo o.class"
 ${TESTJAVA}${FS}bin${FS}javac -d ${TESTCLASSES} ${TESTSRC}${FS}ClassnameCharTest.java
 
-${TESTJAVA}${FS}bin${FS}java -classpath ${TESTCLASSES}${PS}${TESTCLASSES}${FS}sun${FS}misc${FS}URLClassPath ClassnameCharTest
+${TESTJAVA}${FS}bin${FS}java -classpath "${TESTCLASSES}${PS}${TESTCLASSES}${FS}sun${FS}misc${FS}URLClassPath" ClassnameCharTest
 
 rm -rf "fo o.class" testclasses.jar
--- a/jdk/test/sun/tools/common/ApplicationSetup.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/sun/tools/common/ApplicationSetup.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -45,7 +45,11 @@
   # "java" process.
   if [ "$OS" = "Windows" ]; then
     sleep 2
-    realpid=`ps -o pid,ppid,comm|grep ${pid}|grep "java"|cut -c1-6`
+    if [ "${isCygwin}" = "true" ] ; then
+      realpid=`ps -p ${pid} | tail -1 | awk '{print $4;}'`
+    else
+      realpid=`ps -o pid,ppid,comm|grep ${pid}|grep "java"|cut -c1-6`
+    fi
     pid=${realpid}
   fi
                                                                                                      
--- a/jdk/test/sun/tools/common/CommonSetup.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/sun/tools/common/CommonSetup.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -67,6 +67,11 @@
     PS=";"
     OS="Windows"
     ;;
+  CYGWIN* )
+    PS=";"
+    OS="Windows"
+    isCygwin=true
+    ;;
   * )
     PS=":"
     ;;
--- a/jdk/test/sun/tools/jps/jps-help.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/sun/tools/jps/jps-help.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -35,7 +35,7 @@
 rm -f jps.out 2>/dev/null
 ${JPS} -? > jps.out 2>&1
 
-diff jps.out ${TESTSRC}/usage.out
+diff -w jps.out ${TESTSRC}/usage.out
 if [ $? != 0 ]
 then
   echo "Output of jps -? differ from expected output. Failed."
@@ -46,7 +46,7 @@
 rm -f jps.out 2>/dev/null
 ${JPS} -help > jps.out 2>&1
 
-diff jps.out ${TESTSRC}/usage.out
+diff -w jps.out ${TESTSRC}/usage.out
 if [ $? != 0 ]
 then
   echo "Output of jps -help differ from expected output. Failed."
--- a/jdk/test/sun/tools/jstat/jstatHelp.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/sun/tools/jstat/jstatHelp.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -35,7 +35,7 @@
 rm -f jstat.out 2>/dev/null
 ${JSTAT} -? > jstat.out 2>&1
 
-diff jstat.out ${TESTSRC}/usage.out
+diff -w jstat.out ${TESTSRC}/usage.out
 if [ $? != 0 ]
 then
   echo "Output of jstat -? differ from expected output. Failed."
@@ -45,7 +45,7 @@
 rm -f jstat.out 2>/dev/null
 ${JSTAT} -help > jstat.out 2>&1
 
-diff jstat.out ${TESTSRC}/usage.out
+diff -w jstat.out ${TESTSRC}/usage.out
 if [ $? != 0 ]
 then
   echo "Output of jstat -help differ from expected output. Failed."
--- a/jdk/test/sun/tools/jstat/jstatOptions1.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/sun/tools/jstat/jstatOptions1.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -35,4 +35,4 @@
 rm -f jstat.out 2>/dev/null
 ${JSTAT} -options > jstat.out 2>&1
 
-diff jstat.out ${TESTSRC}/options1.out
+diff -w jstat.out ${TESTSRC}/options1.out
--- a/jdk/test/sun/tools/jstatd/jstatdUsage1.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/sun/tools/jstatd/jstatdUsage1.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -37,7 +37,7 @@
 
 ${JSTATD} -? > ${JSTATD_1_OUT} 2>&1
 
-diff ${JSTATD_1_OUT} ${TESTSRC}/usage.out
+diff -w ${JSTATD_1_OUT} ${TESTSRC}/usage.out
 if [ $? != 0 ]
 then
   echo "Output of jstatd -? differs from expected output. Failed."
@@ -46,7 +46,7 @@
 
 ${JSTATD} -help > ${JSTATD_2_OUT} 2>&1
 
-diff ${JSTATD_2_OUT} ${TESTSRC}/usage.out
+diff -w ${JSTATD_2_OUT} ${TESTSRC}/usage.out
 if [ $? != 0 ]
 then
   echo "Output of jstatd -help differs from expected output. Failed."
--- a/jdk/test/sun/tools/native2ascii/Native2AsciiTests.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/sun/tools/native2ascii/Native2AsciiTests.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -32,7 +32,7 @@
 if [ "${TESTJAVA}" = "" ]; then TESTJAVA=$1; shift; fi
 
 case `uname -s` in
-  Windows*) OS=Windows;;
+  Windows* | CYGWIN*) OS=Windows;;
   SunOS|Linux) OS=Unix;;
 esac
 
@@ -45,12 +45,14 @@
 
   # Strip carriage returns from output when comparing with n2a test output
   # on win32 systems
-  if [ OS = Windows ]; then
-     tr -d '\015' <$out >$out.1
+  if [ ${OS} = Windows ]; then
+     sed -e 's@\\r@@g' $out >$out.1
+     sed -e 's@\\r@@g' $expected >$out.expected
   else
      cp $out $out.1
+     cp $expected $out.expected
   fi
-  if (set -x; diff -c $expected $out.1); then
+  if (set -x; diff -c $out.expected $out.1); then
     echo "$bug passed"
   else
     echo "$bug failed"
--- a/jdk/test/tools/launcher/ChangeDataModel.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/tools/launcher/ChangeDataModel.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -29,6 +29,9 @@
 
 OS=`uname -s`;
 
+# To remove CR from output, needed for java apps in CYGWIN, harmless otherwise
+SED_CR="sed -e s@\\r@@g"
+
 case "$OS" in
 	Windows* | CYGWIN* )
 	  PATHSEP=";"
@@ -79,10 +82,10 @@
 
 # Verify data model flag for default data model is accepted
 
-DM=`$JAVA GetDataModel`
+DM=`$JAVA GetDataModel | ${SED_CR}`
 case "$DM" in
         32 )
-		DM2=`${JAVA} -d32 GetDataModel`	
+		DM2=`${JAVA} -d32 GetDataModel | ${SED_CR}`	
 		if [ "${DM2}" != "32" ]
 		then
 	  	echo "Data model flag -d32 not accepted or had improper effect."
@@ -91,7 +94,7 @@
         ;;
 
         64 )
-		DM2=`${JAVA} -d64 GetDataModel`	
+		DM2=`${JAVA} -d64 GetDataModel | ${SED_CR}`	
 		if [ "${DM2}" != "64" ]
 		then
 	  	echo "Data model flag -d64 not accepted or had improper effect."
@@ -227,10 +230,10 @@
 else
 # Negative tests for non-dual mode platforms to ensure the other data model is 
 # rejected
-	DM=`$JAVA GetDataModel`
+	DM=`$JAVA GetDataModel | ${SED_CR}`
 	case "$DM" in
 	   32 )
-		DM2=`${JAVA} -d64 GetDataModel`	
+		DM2=`${JAVA} -d64 GetDataModel | ${SED_CR}`	
 		if [ "x${DM2}" != "x" ]
 		then
 		   echo "Data model flag -d64 was accepted."
@@ -239,7 +242,7 @@
            ;;
 
 	   64 )
-		DM2=`${JAVA} -d32 GetDataModel`	
+		DM2=`${JAVA} -d32 GetDataModel | ${SED_CR}`	
 		if [ "x${DM2}" != "x" ]
 		  then
 		    echo "Data model flag -d32 was accepted."
--- a/jdk/test/tools/launcher/ClassPathWildCard.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/tools/launcher/ClassPathWildCard.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -145,7 +145,7 @@
 
 OS=`uname -s`
 case $OS in 
-    Windows*|Cygwin*)
+    Windows*|CYGWIN*)
         PATHSEP=";"
         ExecJava "" "${PATHSEP}NOOPDIR"
         ExecJava "w" "${PATHSEP}NOOPDIR"
--- a/jdk/test/tools/launcher/DefaultLocaleTest.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/tools/launcher/DefaultLocaleTest.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -48,7 +48,7 @@
 OS=`uname`
 
 case "$OS" in
-        Windows* | CYGWIN* )
+        Windows* )
             JAVAC="${TESTJAVA}/bin/javac -d . "
             JAVA="${TESTJAVA}/bin/java -classpath . "
             JAVAW="${TESTJAVA}/bin/javaw -classpath . "
@@ -64,6 +64,22 @@
             echo "Test passes"
             exit 0
         ;;
+        CYGWIN* )
+            JAVAC="${TESTJAVA}/bin/javac -d . "
+            JAVA="${TESTJAVA}/bin/java -classpath . "
+            JAVAW="${TESTJAVA}/bin/javaw -classpath . "
+
+            ${JAVAC} ${TESTSRC}/DefaultLocaleTest.java
+            ${JAVA} DefaultLocaleTest | sed -e s@\\r@@g > x.out
+            ${JAVAW} DefaultLocaleTest `cat x.out`
+            if [ $? -ne 0 ]
+            then
+                echo "Test fails"
+                exit 1
+            fi
+            echo "Test passes"
+            exit 0
+        ;;
         * )
         echo "Non-windows environment; test vacuously succeeds."
         exit 0;
--- a/jdk/test/tools/launcher/UnicodeTest.sh	Tue Jan 05 10:40:44 2010 +0800
+++ b/jdk/test/tools/launcher/UnicodeTest.sh	Tue Jan 05 13:44:09 2010 -0800
@@ -54,7 +54,7 @@
 
 echo "creating test source files"
 "$JAVAC" -d . "${TESTSRC}"/UnicodeTest.java
-CLASS_NAME=`"$JAVA" UnicodeTest`
+CLASS_NAME=`"$JAVA" UnicodeTest | sed -e 's@\\r@@g' `
 
 if [ "$CLASS_NAME" = "" ]
 then