re GNATS gcj/124 (protected constructor for InvocationTargetException still visible)
authorTom Tromey <tromey@cygnus.com>
Mon, 6 Mar 2000 06:05:02 +0000 (06:05 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Mon, 6 Mar 2000 06:05:02 +0000 (06:05 +0000)
* lib/libjava.exp (test_libjava): Document `shouldfail' token.
(test_libjava_from_source): Handle `shouldfail' case.
(test_libjava_from_javac): Likewise.

Test for PR libgcj/124:
* libjava.compile/PR124.java: New file.
* libjava.compile/PR124.xfail: New file.

From-SVN: r32353

libjava/testsuite/ChangeLog
libjava/testsuite/Makefile.in
libjava/testsuite/lib/libjava.exp
libjava/testsuite/libjava.compile/PR124.java [new file with mode: 0644]
libjava/testsuite/libjava.compile/PR124.xfail [new file with mode: 0644]

index 8940bfc7c694a73217bf747f4ee441d4473baead..7d393bc4eca8e559a468641f028992151f290e82 100644 (file)
@@ -1,3 +1,13 @@
+2000-03-05  Tom Tromey  <tromey@cygnus.com>
+
+       * lib/libjava.exp (test_libjava): Document `shouldfail' token.
+       (test_libjava_from_source): Handle `shouldfail' case.
+       (test_libjava_from_javac): Likewise.
+
+       Test for PR libgcj/124:
+       * libjava.compile/PR124.java: New file.
+       * libjava.compile/PR124.xfail: New file.
+
 2000-03-05  Anthony Green  <green@redhat.com>
 
        * libjava.lang/PR141.java: New file.
index 614f14f6554fe617435fed7b7b4ed01f312d61a9..ed58a1fdf3b62e87f47d5443e975b3020f8699dd 100644 (file)
@@ -136,7 +136,7 @@ DIST_COMMON =  ChangeLog Makefile.am Makefile.in
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
-TAR = gtar
+TAR = tar
 GZIP_ENV = --best
 all: all-redirect
 .SUFFIXES:
@@ -164,7 +164,7 @@ distdir: $(DISTFILES)
        @for file in $(DISTFILES); do \
          d=$(srcdir); \
          if test -d $$d/$$file; then \
-           cp -pr $$d/$$file $(distdir)/$$file; \
+           cp -pr $$/$$file $(distdir)/$$file; \
          else \
            test -f $(distdir)/$$file \
            || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
index 341b2dee680756e35121096ba76e0f60aa18c008..797741b295cfbeb504c1129de5f3be468f5d5847 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1998, 1999 Red Hat, Inc.
+# Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
 
 load_lib "libgloss.exp"
 
@@ -275,6 +275,11 @@ proc libjava_arguments {{mode compile}} {
 #   `xfail-gcj'   compilation from source will fail
 #   `xfail-javac' compilation with javac will fail
 #   `xfail-gcjC'  compilation with gcj -C will fail
+#   `shouldfail'  compilation from source is supposed to fail
+#                 This is different from xfail, which marks a known
+#                 failure that we just havne't fixed.
+#                 A compilation marked this way should fail with any
+#                 front end.
 #   `xfail-byte'  compilation from bytecode will fail
 #   `xfail-exec'  exec will fail
 #   `xfail-output' output will be wrong
@@ -334,6 +339,12 @@ proc test_libjava_from_source { options srcfile compile_args inpfile resultfile
     }
     if { $x != "" } {
        verbose "target_compile failed: $x" 2
+
+       if {[info exists opts(shouldfail)]} {
+           pass "$errname compilation from source"
+           return
+       }
+
        fail "$errname compilation from source"
        if {[info exists opts(xfail-gcj)] || ! [info exists opts(no-exec)]} {
            setup_xfail "*-*-*"
@@ -341,7 +352,11 @@ proc test_libjava_from_source { options srcfile compile_args inpfile resultfile
            setup_xfail "*-*-*"
            fail "$errname output from source compiled test"
        }
-       return;
+       return
+    }
+    if {[info exists opts(shouldfail)]} {
+       fail "$errname compilation from source"
+       return
     }
     pass "$errname compilation from source"
 
@@ -409,6 +424,11 @@ proc test_libjava_from_source { options srcfile compile_args inpfile resultfile
 #   `xfail-gcj'   compilation from source will fail
 #   `xfail-javac' compilation with javac will fail
 #   `xfail-gcjC'  compilation with gcj -C will fail
+#   `shouldfail'  compilation from source is supposed to fail
+#                 This is different from xfail, which marks a known
+#                 failure that we just havne't fixed.
+#                 A compilation marked this way should fail with any
+#                 front end.
 #   `xfail-byte'  compilation from bytecode will fail
 #   `xfail-exec'  exec will fail
 #   `xfail-output' output will be wrong
@@ -443,6 +463,10 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
        setup_xfail *-*-*
     }
     if {! $bc_ok} then {
+       if {[info exists opts(shouldfail)]} {
+           pass "$errname byte compilation"
+           return
+       }
        fail "$errname byte compilation"
        setup_xfail "*-*-*"
        fail "$errname compilation from bytecode"
@@ -454,6 +478,10 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
        }
        return
     }
+    if {[info exists opts(shouldfail)]} {
+       fail "$errname byte compilation"
+       return
+    }
     pass "$errname byte compilation"
 
     # Find name to use for --main, and name of all class files.
@@ -607,10 +635,15 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
 # Run the test specified by srcfile and resultfile. compile_args and
 # exec_args are options telling this proc how to work.
 #   `no-link'     don't try to link the program
-#   `no-exec' don't try to run the test
+#   `no-exec'     don't try to run the test
 #   `xfail-gcj'   compilation from source will fail
 #   `xfail-javac' compilation with javac will fail
 #   `xfail-gcjC'  compilation with gcj -C will fail
+#   `shouldfail'  compilation from source is supposed to fail
+#                 This is different from xfail, which marks a known
+#                 failure that we just havne't fixed.
+#                 A compilation marked this way should fail with any
+#                 front end.
 #   `xfail-byte'  compilation from bytecode will fail
 #   `xfail-exec'  exec will fail
 #   `xfail-output' output will be wrong
diff --git a/libjava/testsuite/libjava.compile/PR124.java b/libjava/testsuite/libjava.compile/PR124.java
new file mode 100644 (file)
index 0000000..2ec1fe9
--- /dev/null
@@ -0,0 +1,9 @@
+import java.lang.reflect.*;
+
+public class PR124
+{
+  public static void main (String[] args)
+  {
+    System.out.println (new InvocationTargetException ());
+  }
+}
diff --git a/libjava/testsuite/libjava.compile/PR124.xfail b/libjava/testsuite/libjava.compile/PR124.xfail
new file mode 100644 (file)
index 0000000..e3b083b
--- /dev/null
@@ -0,0 +1 @@
+shouldfail