6877188: some javac shell tests do not work on Windows
authorjjg
Fri, 28 Aug 2009 14:48:49 -0700
changeset 3772 b55aba011888
parent 3771 6e7b16ecca30
child 3773 054ea6d9111b
6877188: some javac shell tests do not work on Windows Reviewed-by: darcy
langtools/test/tools/javac/4846262/Test.sh
langtools/test/tools/javac/6302184/T6302184.sh
langtools/test/tools/javac/ClassPathTest/ClassPathTest.sh
langtools/test/tools/javac/ExtDirs/ExtDirs.sh
langtools/test/tools/javac/ProtectedInnerClass/ProtectedInnerClass.sh
langtools/test/tools/javac/javazip/Test.sh
langtools/test/tools/javac/newlines/Newlines.sh
langtools/test/tools/javac/unicode/SupplementaryJavaID6.sh
--- a/langtools/test/tools/javac/4846262/Test.sh	Fri Aug 28 12:12:08 2009 -0700
+++ b/langtools/test/tools/javac/4846262/Test.sh	Fri Aug 28 14:48:49 2009 -0700
@@ -45,13 +45,13 @@
 OS=`uname -s`
 case "$OS" in
   SunOS | Linux )
-    NULL=/dev/null
-    PS=":"
     FS="/"
     ;;
+  CYGWIN* )
+    FS="/"
+    DIFFOPTS="--strip-trailing-cr"
+    ;;
   Windows* )
-    NULL=NUL
-    PS=";"
     FS="\\"
     ;;
   * )
@@ -68,7 +68,7 @@
 
 "${TESTJAVA}${FS}bin${FS}native2ascii" ${TESTTOOLVMOPTS} -encoding IBM1047 Test.tmp Test.out
 
-diff -c "${TESTSRC}${FS}Test.out" Test.out
+diff ${DIFFOPTS} -c "${TESTSRC}${FS}Test.out" Test.out
 result=$?
 
 if [ $result -eq o ]
--- a/langtools/test/tools/javac/6302184/T6302184.sh	Fri Aug 28 12:12:08 2009 -0700
+++ b/langtools/test/tools/javac/6302184/T6302184.sh	Fri Aug 28 14:48:49 2009 -0700
@@ -42,13 +42,13 @@
 OS=`uname -s`
 case "$OS" in
   SunOS | Linux )
-    NULL=/dev/null
-    PS=":"
     FS="/"
     ;;
+  CYGWIN* )
+    FS="/"
+    DIFFOPTS="--strip-trailing-cr"
+    ;;
   Windows* )
-    NULL=NUL
-    PS=";"
     FS="\\"
     ;;
   * )
@@ -57,8 +57,8 @@
     ;;
 esac
 
-"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d ${TC} -cp ${TC} -encoding iso-8859-1 -XD-printsource ${TS}${FS}T6302184.java 2>&1 > ${NULL}
-diff -c ${TC}${FS}T6302184.java ${TS}${FS}T6302184.out
+"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d ${TC} -cp ${TC} -encoding iso-8859-1 -XD-printsource ${TS}${FS}T6302184.java 2>&1
+diff ${DIFFOPTS} -c ${TC}${FS}T6302184.java ${TS}${FS}T6302184.out
 result=$?
 
 
--- a/langtools/test/tools/javac/ClassPathTest/ClassPathTest.sh	Fri Aug 28 12:12:08 2009 -0700
+++ b/langtools/test/tools/javac/ClassPathTest/ClassPathTest.sh	Fri Aug 28 14:48:49 2009 -0700
@@ -56,14 +56,10 @@
 # set platform-dependent variables
 OS=`uname -s`
 case "$OS" in
-  SunOS | Linux )
-    NULL=/dev/null
-    PS=":"
+  SunOS | Linux | CYGWIN* )
     FS="/"
     ;;
   Windows* )
-    NULL=NUL
-    PS=";"
     FS="\\"
     ;;
   * )
--- a/langtools/test/tools/javac/ExtDirs/ExtDirs.sh	Fri Aug 28 12:12:08 2009 -0700
+++ b/langtools/test/tools/javac/ExtDirs/ExtDirs.sh	Fri Aug 28 14:48:49 2009 -0700
@@ -55,12 +55,14 @@
 OS=`uname -s`
 case "$OS" in
   SunOS | Linux )
-    NULL=/dev/null
     PS=":"
     FS="/"
     ;;
+  CYGWIN* )
+    PS=";" # native PS, not Cygwin PS
+    FS="/"
+    ;;
   Windows* )
-    NULL=NUL
     PS=";"
     FS="\\"
     ;;
--- a/langtools/test/tools/javac/ProtectedInnerClass/ProtectedInnerClass.sh	Fri Aug 28 12:12:08 2009 -0700
+++ b/langtools/test/tools/javac/ProtectedInnerClass/ProtectedInnerClass.sh	Fri Aug 28 14:48:49 2009 -0700
@@ -53,12 +53,14 @@
 OS=`uname -s`
 case "$OS" in
   SunOS | Linux )
-    NULL=/dev/null
     PS=":"
     FS="/"
     ;;
+  CYGWIN* ) 
+    PS=";" # native PS, not Cygwin PS
+    FS="/"
+    ;;
   Windows* )
-    NULL=NUL
     PS=";"
     FS="\\"
     ;;
--- a/langtools/test/tools/javac/javazip/Test.sh	Fri Aug 28 12:12:08 2009 -0700
+++ b/langtools/test/tools/javac/javazip/Test.sh	Fri Aug 28 14:48:49 2009 -0700
@@ -42,14 +42,16 @@
 OS=`uname -s`
 case "$OS" in
   SunOS | Linux )
-    NULL=/dev/null
-    PS=":"
     FS="/"
+    SCR=`pwd`
+    ;;
+  CYGWIN* )
+    FS="/"
+    SCR=`pwd | cygpath -d`
     ;;
   Windows* )
-    NULL=NUL
-    PS=";"
     FS="\\"
+    SCR=`pwd`
     ;;
   * )
     echo "Unrecognized system!"
--- a/langtools/test/tools/javac/newlines/Newlines.sh	Fri Aug 28 12:12:08 2009 -0700
+++ b/langtools/test/tools/javac/newlines/Newlines.sh	Fri Aug 28 14:48:49 2009 -0700
@@ -50,14 +50,10 @@
 # set platform-dependent variables
 OS=`uname -s`
 case "$OS" in
-  SunOS | Linux )
-    NULL=/dev/null
-    PS=":"
+  SunOS | Linux | CYGWIN* )
     FS="/"
     ;;
   Windows* )
-    NULL=NUL
-    PS=";"
     FS="\\"
     ;;
   * )
--- a/langtools/test/tools/javac/unicode/SupplementaryJavaID6.sh	Fri Aug 28 12:12:08 2009 -0700
+++ b/langtools/test/tools/javac/unicode/SupplementaryJavaID6.sh	Fri Aug 28 14:48:49 2009 -0700
@@ -75,6 +75,11 @@
     PS=";"
     FS="\\"
     ;;
+  CYGWIN* )
+    ENV=""
+    PS=";" # platform PS, not cygwin PS
+    FS="/"
+    ;;
   * )
     echo "Unrecognized system!"
     exit 1;