summaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-11 22:23:13 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-11 22:23:13 +0000
commit0bbceaf63f45c7589d38327726c78ff25382bc7f (patch)
tree49362cdc534853e639889ba366b4a073c3c6cb00 /libjava
parent3d6cc54962137a93e701823e3f9b00f581c68865 (diff)
downloadgcc-0bbceaf63f45c7589d38327726c78ff25382bc7f.tar.gz
* libjava.verify/verify.exp: New file.
* libjava.verify/README.verify: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69253 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r--libjava/testsuite/ChangeLog5
-rw-r--r--libjava/testsuite/libjava.verify/README.verify10
-rw-r--r--libjava/testsuite/libjava.verify/verify.exp81
3 files changed, 96 insertions, 0 deletions
diff --git a/libjava/testsuite/ChangeLog b/libjava/testsuite/ChangeLog
index 1771b13dda4..def930069b0 100644
--- a/libjava/testsuite/ChangeLog
+++ b/libjava/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2003-07-10 Tom Tromey <tromey@redhat.com>
+
+ * libjava.verify/verify.exp: New file.
+ * libjava.verify/README.verify: New file.
+
2003-07-09 Jeff Sturm <jsturm@one-point.com>
* libjava.lang/SyncTest.java (run): Cache .class value.
diff --git a/libjava/testsuite/libjava.verify/README.verify b/libjava/testsuite/libjava.verify/README.verify
new file mode 100644
index 00000000000..d28cdf82ca3
--- /dev/null
+++ b/libjava/testsuite/libjava.verify/README.verify
@@ -0,0 +1,10 @@
+The verifier tests come from Mauve.
+See http://sources.redhat.com/mauve
+
+You want the "verify" module in the Mauve cvs repository.
+
+In Mauve, only the sources are checked in. However, these need
+jasmin to be compiled to bytecode. Since jasmin would require either
+another VM or gcj itself to already be working and installed (just to
+compile it), we've chose to precompile all the .j files to .class
+files and then import the result.
diff --git a/libjava/testsuite/libjava.verify/verify.exp b/libjava/testsuite/libjava.verify/verify.exp
new file mode 100644
index 00000000000..90747780c59
--- /dev/null
+++ b/libjava/testsuite/libjava.verify/verify.exp
@@ -0,0 +1,81 @@
+# Tests for class verifier.
+
+global gcj_verify_xfail
+set gcj_verify_xfail("gij verify of call.fail.Static") 1
+set gcj_verify_xfail("gij verify of simple.fail.dupfield") 1
+set gcj_verify_xfail("gij verify of simple.fail.dupinterface") 1
+set gcj_verify_xfail("gij verify of simple.fail.dupmethod") 1
+set gcj_verify_xfail("gij verify of subr.fail.jsr10") 1
+set gcj_verify_xfail("gij verify of subr.fail.jsr8") 1
+
+
+proc gcj_verify_list_tests {srcdir} {
+ set result {}
+ set here [pwd]
+ cd $srcdir
+ foreach item [lsort [glob -nocomplain */*/*.class]] {
+ lappend result [file rootname $item]
+ }
+ cd $here
+ return $result
+}
+
+proc gcj_verify_test_gij {gij srcdir test shouldfail} {
+ global gcj_verify_xfail
+
+ set testname "gij verify of $test"
+ verbose "invoking gij $test - shouldfail=$shouldfail"
+ set result [libjava_load $gij [list --cp $srcdir $test] ""]
+ set status [lindex $result 0]
+ set output [lindex $result 1]
+
+ if {$shouldfail} {
+ # We match the few exceptions that are allowed. This may need
+ # updating from time to time. We do this rather than check the
+ # exit status because we want to catch the case where gij dies in
+ # some inappropriate way.
+ if {[string match *VerifyError* $output]
+ || [string match *AbstractMethodError* $output]
+ || [string match *IncompatibleClassChangeError* $output]} {
+ set cmd pass
+ } else {
+ set cmd fail
+ }
+ if {[info exists gcj_verify_xfail($testname)]} {
+ setup_xfail *-*-*
+ }
+ } else {
+ if {$status == "pass"} {
+ set cmd pass
+ } else {
+ set cmd fail
+ }
+ }
+ $cmd $testname
+}
+
+proc gcj_verify_run {} {
+ global INTERPRETER srcdir
+
+ set gij [libjava_find_gij]
+ set interpret 1
+ # libjava_find_gij will return `gij' if it couldn't find the
+ # program; in this case we want to skip the test.
+ if {$INTERPRETER != "yes" || $gij == "gij"} {
+ set interpret 0
+ }
+
+ set testsdir $srcdir/libjava.verify/verify
+ foreach test [gcj_verify_list_tests $testsdir] {
+ set shouldfail [string match */fail/* $test]
+
+ if {$interpret} {
+ regsub -all -- / $test . gijname
+ gcj_verify_test_gij $gij $testsdir $gijname $shouldfail
+ }
+
+ # FIXME: run gcj --syntax-only here.
+ }
+}
+
+gcj_verify_run