From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- libjava/testsuite/libjava.verify/verify.exp | 83 +++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 libjava/testsuite/libjava.verify/verify.exp (limited to 'libjava/testsuite/libjava.verify/verify.exp') diff --git a/libjava/testsuite/libjava.verify/verify.exp b/libjava/testsuite/libjava.verify/verify.exp new file mode 100644 index 000000000..4abdc18ac --- /dev/null +++ b/libjava/testsuite/libjava.verify/verify.exp @@ -0,0 +1,83 @@ +# 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 {} + if {[file exists $srcdir]} { + 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 "" if it couldn't find the + # program; in this case we want to skip the test. + if {$INTERPRETER != "yes" || $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 -- cgit v1.2.3