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 # libjava_find_gij will
return "" if it couldn't find the
24 #
program; in this case we want to skip the test.
25 if {$INTERPRETER
!= "yes" || $gij == ""} {
26 untested
"$jarfile execution - gij test"
27 untested
"$jarfile output - gij test"
32 set out
[file rootname $jarfile
].out
33 libjava_invoke $jarfile
"gij test" opts $gij {} $out \
38 global srcdir subdir env
39 foreach jar
[lsort
[glob
-nocomplain $
{srcdir
}/$
{subdir
}/*.jar
]] {
40 set xff
[file rootname $jar
].xfail
43 foreach item
[libjava_read_xfail $xff
] {
44 if {[string match main
=* $item
]} {
45 set main
[string range $item
5 end
]
47 } elseif
{$item
== "no-interpret"} {
52 gcj_jar_compile_one $jar $main
54 gcj_jar_interpret $jar
57 # When we succeed we remove all our clutter.
58 eval gcj_cleanup
[glob
-nocomplain
-- $
{main
}.
*] [list $main
]
60 # Reset CLASSPATH that we
do not look into testsuite
/libjava.jar
for *.jar
61 # files which
do not belong to the libgcj itself.