1 # Tests
for .jar files.
3 #
Compile a single .jar file to an executable.
4 # Returns
0 on failure.
5 proc gcj_jar_link
{jarfile mainclass
} {
8 proc gcj_jar_compile_one
{jarfile mainclass
} {
9 set base
[file rootname
[file tail $jarfile
]]
10 set out
[file rootname $jarfile
].out
12 if {! [gcj_link $base $mainclass
[list $jarfile
]]} {
16 gcj_invoke $base $out
{}
19 proc gcj_jar_interpret
{jarfile
} {
20 global INTERPRETER srcdir
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"
33 set out
[file rootname $jarfile
].out
34 libjava_invoke $errname
"gij test" opts $gij {} $out \
39 global srcdir subdir env
40 foreach jar
[lsort
[glob
-nocomplain $
{srcdir
}/$
{subdir
}/*.jar
]] {
41 set xff
[file rootname $jar
].xfail
44 foreach item
[libjava_read_xfail $xff
] {
45 if {[string match main
=* $item
]} {
46 set main
[string range $item
5 end
]
48 } elseif
{$item
== "no-interpret"} {
53 gcj_jar_compile_one $jar $main
55 gcj_jar_interpret $jar
58 # When we succeed we remove all our clutter.
59 eval gcj_cleanup
[glob
-nocomplain
-- $
{main
}.
*] [list $main
]
61 # Reset CLASSPATH that we
do not look into testsuite
/libjava.jar
for *.jar
62 # files which
do not belong to the libgcj itself.