OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [testsuite/] [libjava.verify/] [verify.exp] - Blame information for rev 765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 765 jeremybenn
# Tests for class verifier.
2
 
3
global gcj_verify_xfail
4
set {gcj_verify_xfail(gij verify of call.fail.Static)} 1
5
set {gcj_verify_xfail(gij verify of simple.fail.dupfield)} 1
6
set {gcj_verify_xfail(gij verify of simple.fail.dupinterface)} 1
7
set {gcj_verify_xfail(gij verify of simple.fail.dupmethod)} 1
8
set {gcj_verify_xfail(gij verify of subr.fail.jsr10)} 1
9
set {gcj_verify_xfail(gij verify of subr.fail.jsr8)} 1
10
 
11
 
12
proc gcj_verify_list_tests {srcdir} {
13
  set result {}
14
  if {[file exists $srcdir]} {
15
    set here [pwd]
16
    cd $srcdir
17
    foreach item [lsort [glob -nocomplain */*/*.class]] {
18
      lappend result [file rootname $item]
19
    }
20
    cd $here
21
  }
22
  return $result
23
}
24
 
25
proc gcj_verify_test_gij {gij srcdir test shouldfail} {
26
  global gcj_verify_xfail
27
 
28
  set testname "gij verify of $test"
29
  verbose "invoking gij $test  - shouldfail=$shouldfail"
30
  set result [libjava_load $gij [list --cp $srcdir $test] ""]
31
  set status [lindex $result 0]
32
  set output [lindex $result 1]
33
 
34
  if {$shouldfail} {
35
    # We match the few exceptions that are allowed.  This may need
36
    # updating from time to time.  We do this rather than check the
37
    # exit status because we want to catch the case where gij dies in
38
    # some inappropriate way.
39
    if {[string match *VerifyError* $output]
40
        || [string match *AbstractMethodError* $output]
41
        || [string match *IncompatibleClassChangeError* $output]} {
42
      set cmd pass
43
    } else {
44
      set cmd fail
45
    }
46
    if {[info exists gcj_verify_xfail($testname)]} {
47
      setup_xfail *-*-*
48
    }
49
  } else {
50
    if {$status == "pass"} {
51
      set cmd pass
52
    } else {
53
      set cmd fail
54
    }
55
  }
56
  $cmd $testname
57
}
58
 
59
proc gcj_verify_run {} {
60
  global INTERPRETER srcdir
61
 
62
  set gij [libjava_find_gij]
63
  set interpret 1
64
  # libjava_find_gij will return "" if it couldn't find the
65
  # program; in this case we want to skip the test.
66
  if {$INTERPRETER != "yes" || $gij == ""} {
67
    set interpret 0
68
  }
69
 
70
  set testsdir $srcdir/libjava.verify/verify
71
  foreach test [gcj_verify_list_tests $testsdir] {
72
    set shouldfail [string match */fail/* $test]
73
 
74
    if {$interpret} {
75
      regsub -all -- / $test . gijname
76
      gcj_verify_test_gij $gij $testsdir $gijname $shouldfail
77
    }
78
 
79
    # FIXME: run gcj --syntax-only here.
80
  }
81
}
82
 
83
gcj_verify_run

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.