changeset 59:44f4635bf667

6877229: more javac tests fail on Windows Reviewed-by: darcy
author jjg
date Wed, 14 Jan 2009 18:08:00 -0800
parents ea4e7bca9d23
children 26531d3d6bf7
files test/tools/javac/6589361/T6589361.java test/tools/javac/MissingInclude.sh test/tools/javac/T5090006/compiler.sh test/tools/javac/api/6440333/T6440333.java test/tools/javac/api/Sibling.java test/tools/javac/constDebug/ConstDebug.sh test/tools/javac/fatalErrors/NoJavaLang.sh test/tools/javac/innerClassFile/Driver.java test/tools/javac/innerClassFile/Driver.sh test/tools/javac/stackmap/T4955930.sh
diffstat 10 files changed, 27 insertions(+), 58 deletions(-) [+]
line wrap: on
line diff
--- a/test/tools/javac/6589361/T6589361.java	Fri Aug 28 14:48:49 2009 -0700
+++ b/test/tools/javac/6589361/T6589361.java	Wed Jan 14 18:08:00 2009 -0800
@@ -40,7 +40,7 @@
                 fm.close();
             }
         }
-        throw new AssertionError("Could not fing java/lang/Object.class while compiling");
+        throw new AssertionError("Could not find java/lang/Object.class while compiling");
     }
 
 }
--- a/test/tools/javac/MissingInclude.sh	Fri Aug 28 14:48:49 2009 -0700
+++ b/test/tools/javac/MissingInclude.sh	Wed Jan 14 18:08:00 2009 -0800
@@ -47,14 +47,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/test/tools/javac/T5090006/compiler.sh	Fri Aug 28 14:48:49 2009 -0700
+++ b/test/tools/javac/T5090006/compiler.sh	Wed Jan 14 18:08:00 2009 -0800
@@ -47,14 +47,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/test/tools/javac/api/6440333/T6440333.java	Fri Aug 28 14:48:49 2009 -0700
+++ b/test/tools/javac/api/6440333/T6440333.java	Wed Jan 14 18:08:00 2009 -0800
@@ -26,6 +26,7 @@
  * @bug     6440333
  * @summary SimpleJavaFileObject.toString() generates URI with some extra message
  * @author  Peter von der Ah\u00e9
+ * @ignore 6877223 test ignored because of issues with File.toUri on Windows (6877206)
  * @library ../lib
  * @compile T6440333.java
  * @run main T6440333
@@ -42,6 +43,10 @@
         JavaFileObject fo = fm.getJavaFileObjects(src).iterator().next();
         String expect = src.getCanonicalFile().getPath().replace(File.separatorChar, '/');
         System.err.println("Expect " + expect);
+        // CURRENTLY, the following line fails on Windows because a file C:/w/jjg/...
+        // returns a URI file://C/w/jjg... which incorrectly encodes the drive letter
+        // in the URI authority.   This is against the spec that the authority is
+        // undefined and breaks the contract that new File(f.toURI()).equals(f.getAbsoluteFile())
         System.err.println("Got: " +  fo.toUri().getPath());
         if (!expect.equals(fo.toUri().getPath())) {
             throw new AssertionError();
--- a/test/tools/javac/api/Sibling.java	Fri Aug 28 14:48:49 2009 -0700
+++ b/test/tools/javac/api/Sibling.java	Wed Jan 14 18:08:00 2009 -0800
@@ -26,6 +26,7 @@
  * @bug     6399602
  * @summary Verify that files are created relative to sibling
  * @author  Peter von der Ah\u00e9
+ * @ignore 6877223 test ignored because of issues with File.toUri on Windows (6877206)
  */
 
 import java.io.File;
--- a/test/tools/javac/constDebug/ConstDebug.sh	Fri Aug 28 14:48:49 2009 -0700
+++ b/test/tools/javac/constDebug/ConstDebug.sh	Wed Jan 14 18:08:00 2009 -0800
@@ -48,12 +48,14 @@
 OS=`uname -s`
 case "$OS" in
   SunOS | Linux )
-    NULL=/dev/null
     PS=":"
     FS="/"
     ;;
+  CYGWIN* )
+    PS=";" # Platform PS, not Cygwin PS
+    FS="/"
+    ;;
   Windows* )
-    NULL=NUL
     PS=";"
     FS="\\"
     ;;
@@ -69,7 +71,7 @@
 "${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -g -d . -classpath .${PS}${TESTSRC} $1.java 2> ${TMP1}
 result=$?
 if [ $result -ne 0 ]; then exit $result; fi
-if strings $1.class | grep clinit; then
+if "${TESTJAVA}${FS}bin${FS}javap" $1.class | grep clinit; then
   echo "Failed"
   exit 1;
 else
--- a/test/tools/javac/fatalErrors/NoJavaLang.sh	Fri Aug 28 14:48:49 2009 -0700
+++ b/test/tools/javac/fatalErrors/NoJavaLang.sh	Wed Jan 14 18:08:00 2009 -0800
@@ -49,13 +49,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="\\"
     ;;
   * )
@@ -98,7 +98,7 @@
 
 # expected message
 cat "${TMP1}"
-diff -c "${TESTSRC}${FS}NoJavaLang.out" "${TMP1}"
+diff ${DIFFOPTS} -c "${TESTSRC}${FS}NoJavaLang.out" "${TMP1}"
 result=$?
 rm "${TMP1}"
 
--- a/test/tools/javac/innerClassFile/Driver.java	Fri Aug 28 14:48:49 2009 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright 2002 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-/*
- * @test
- * @bug 4491755 4785453
- * @summary Prob w/static inner class with same name as a regular class
- * @author gafter
- *
- * @run shell Driver.sh
- */
-
-// this is not a real source file, just the tags to run this test.
--- a/test/tools/javac/innerClassFile/Driver.sh	Fri Aug 28 14:48:49 2009 -0700
+++ b/test/tools/javac/innerClassFile/Driver.sh	Wed Jan 14 18:08:00 2009 -0800
@@ -23,6 +23,12 @@
 # have any questions.
 #
 
+# @test
+# @bug 4491755 4785453
+# @summary Prob w/static inner class with same name as a regular class
+# @author gafter
+#
+# @run shell Driver.sh
 
 if [ "${TESTSRC}" = "" ]
 then
@@ -47,14 +53,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/test/tools/javac/stackmap/T4955930.sh	Fri Aug 28 14:48:49 2009 -0700
+++ b/test/tools/javac/stackmap/T4955930.sh	Wed Jan 14 18:08:00 2009 -0800
@@ -41,7 +41,7 @@
 # set platform-dependent variables
 OS=`uname -s`
 case "$OS" in
-  SunOS | Linux )
+  SunOS | Linux | CYGWIN* )
     FS="/"
     ;;
   Windows_95 | Windows_98 | Windows_NT )