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

Subversion Repositories openrisc

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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 765 jeremybenn
# Tests for .jar files.
2
 
3
# Compile a single .jar file to an executable.
4
# Returns 0 on failure.
5
proc gcj_jar_link {jarfile mainclass} {
6
}
7
 
8
proc gcj_jar_compile_one {jarfile mainclass} {
9
  set base [file rootname [file tail $jarfile]]
10
  set out [file rootname $jarfile].out
11
 
12
  if {! [gcj_link $base $mainclass [list $jarfile]]} {
13
    return
14
  }
15
 
16
  gcj_invoke $base $out {}
17
}
18
 
19
proc gcj_jar_interpret {jarfile} {
20
  global INTERPRETER srcdir
21
 
22
  set gij [libjava_find_gij]
23
  set errname [dg-trim-dirname $srcdir $jarfile]
24
  # libjava_find_gij will return "" if it couldn't find the
25
  # program; in this case we want to skip the test.
26
  if {$INTERPRETER != "yes" || $gij == ""} {
27
    untested "$errname execution - gij test"
28
    untested "$errname output - gij test"
29
    return
30
  }
31
 
32
  set opts(_) {}
33
  set out [file rootname $jarfile].out
34
  libjava_invoke $errname "gij test" opts $gij {} $out \
35
      "" -jar $jarfile
36
}
37
 
38
proc gcj_jar_run {} {
39
  global srcdir subdir env
40
  foreach jar [lsort [glob -nocomplain ${srcdir}/${subdir}/*.jar]] {
41
    set xff [file rootname $jar].xfail
42
    set main {}
43
    set interp 1
44
    foreach item [libjava_read_xfail $xff] {
45
      if {[string match main=* $item]} {
46
        set main [string range $item 5 end]
47
        break
48
      } elseif {$item == "no-interpret"} {
49
        set interp 0
50
      }
51
    }
52
 
53
    gcj_jar_compile_one $jar $main
54
    if {$interp} {
55
      gcj_jar_interpret $jar
56
    }
57
  }
58
    # When we succeed we remove all our clutter.
59
    eval gcj_cleanup [glob -nocomplain -- ${main}.*] [list $main ]
60
 
61
    # Reset CLASSPATH that we do not look into testsuite/libjava.jar for *.jar
62
    # files which do not belong to the libgcj itself.
63
    set env(CLASSPATH) ""
64
 
65
    return 1
66
}
67
 
68
gcj_jar_run

powered by: WebSVN 2.1.0

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