1 # Run the Jacks test suite.
2 # See http
://www
-124.ibm.com
/developerworks
/oss
/cvs
/jikes
/~checkout~
/jacks
/jacks.html
4 proc load_gcc_lib
{ filename
} {
6 load_file $srcdir
/..
/..
/gcc
/testsuite
/lib
/$filename
9 load_gcc_lib target
-libpath.exp
11 proc gcj_jacks_setup_xfail
{ary
} {
15 set fd
[open $srcdir
/libjava.jacks
/jacks.xfail
]
17 set array
([gets $fd
]) {}
22 proc gcj_jacks_write
{filename
} {
25 global libjava_libgcc_s_path
26 global ld_library_path
28 set gcjl
[split $GCJ_UNDER_TEST
]
29 set gcj_cmd
[lindex $gcjl
0]
30 set rest
[join
[lreplace $gcjl
0 0]]
33 set fd
[open $filename w
]
34 puts $fd
"set JAVAC $gcj_cmd"
35 puts $fd
"set JAVA_CLASSPATH \"$libgcj_jar\""
36 puts $fd
"set JAVAC_FLAGS [list $rest]"
37 puts $fd
"set JAVA [list [libjava_find_gij]]"
39 # Without an explicit
limit on the heap size
, tests depending
on
40 # an OutOfMemoryError
(e.g.
"15.9.4-runtime-creation-2") can result
41 # in a lot of unnecessary thrashing.
42 puts $fd
"set JAVA_FLAGS \"-mx=64m\""
44 puts $fd
"set JAVAC_ENCODING_FLAG --encoding="
45 puts $fd
"set JAVAC_DEPRECATION_FLAG -Wdeprecated"
46 puts $fd
"set tcltest::testConstraints(encoding) 1"
47 puts $fd
"set tcltest::testConstraints(gcj) 1"
48 puts $fd
"set tcltest::testConstraints(assert) 1"
49 #
"Time-consuming JVM limitation tests".
50 # puts $fd
"set tcltest::testConstraints(jvm) 1"
53 set ld_library_path $libjava_libgcc_s_path
54 set_ld_library_path_env_vars
57 proc gcj_jacks_parse
{file
} {
58 if {[catch
{open $file
} fd
]} {
59 verbose
"couldn't parse Jacks output: $fd"
63 verbose
"Reading jacks.xfail"
64 gcj_jacks_setup_xfail xfails
68 if {[string match RESULT
* $line
]} {
69 set linelist
[split $line
]
70 set test
[lindex $linelist
1]
71 if {[info exists xfails
($test
)]} {
74 if {[lindex $linelist
2] == "PASSED"} {
85 proc gcj_jacks_run
{} {
88 if {! [file isdirectory $srcdir
/libjava.jacks
/jacks
]} {
90 verbose
"Jacks tests not found"
94 # Jacks forces us to
do this. You can
't run it from a separate
96 verbose "Copying Jacks..."
97 catch {system "rm -rf jacks"}
98 catch {system "cp -r $srcdir/libjava.jacks/jacks jacks"}
103 verbose "Writing Jacks setup file"
104 gcj_jacks_write gcj_setup
106 verbose "Running Jacks..."
107 # Just ignore error exits from the jacks program.
108 # It will always error exit for us, since don't completely pass.
109 # At the moment jacks has a hardcoded
call to tclsh8.3. To override this
,
110 # we check here
on the version and launch the script directly with the
112 set tcl_ver
[info tclversion
]
113 if {[package vcompare $tcl_ver
8.3] >= 0 } {
114 if {[catch
{exec tclsh$tcl_ver jacks gcj
} msg
]} {
115 send_log
"Couldn't run jacks: $msg\n"
118 gcj_jacks_parse logging
/gcj.
log
120 send_log
"No suitable tclsh found, you need at least version 8.3 or up.\n"