1 # Run the Jacks test suite.
2 # See http://www-124.ibm.com/developerworks/oss/cvs/jikes/~checkout~/jacks/jacks.html
4 proc gcj_jacks_setup_xfail {ary} {
8 set fd [open $srcdir/libjava.jacks/jacks.xfail]
10 set array([gets $fd]) {}
15 proc gcj_jacks_write {filename} {
18 global libjava_libgcc_s_path
19 global original_ld_library_path
21 set gcjl [split $GCJ_UNDER_TEST]
22 set gcj_cmd [lindex $gcjl 0]
23 set rest [join [lreplace $gcjl 0 0]]
26 set fd [open $filename w]
27 puts $fd "set JAVAC $gcj_cmd"
28 puts $fd "set JAVA_CLASSPATH \"$libgcj_jar\""
29 puts $fd "set JAVAC_FLAGS [list $rest]"
30 puts $fd "set JAVA [list [libjava_find_gij]]"
32 # Without an explicit limit on the heap size, tests depending on
33 # an OutOfMemoryError (e.g. "15.9.4-runtime-creation-2") can result
34 # in a lot of unnecessary thrashing.
35 puts $fd "set JAVA_FLAGS \"-mx=64m\""
37 puts $fd "set JAVAC_ENCODING_FLAG --encoding="
38 puts $fd "set JAVAC_DEPRECATION_FLAG -Wdeprecated"
39 puts $fd "set tcltest::testConstraints(encoding) 1"
40 puts $fd "set tcltest::testConstraints(gcj) 1"
41 puts $fd "set tcltest::testConstraints(assert) 1"
42 # "Time-consuming JVM limitation tests".
43 # puts $fd "set tcltest::testConstraints(jvm) 1"
46 setenv LD_LIBRARY_PATH $libjava_libgcc_s_path:$original_ld_library_path
49 proc gcj_jacks_parse {file} {
50 if {[catch {open $file} fd]} {
51 verbose "couldn't parse Jacks output: $fd"
55 verbose "Reading jacks.xfail"
56 gcj_jacks_setup_xfail xfails
60 if {[string match RESULT* $line]} {
61 set linelist [split $line]
62 set test [lindex $linelist 1]
63 if {[info exists xfails($test)]} {
66 if {[lindex $linelist 2] == "PASSED"} {
77 proc gcj_jacks_run {} {
80 if {! [file isdirectory $srcdir/libjava.jacks/jacks]} {
82 verbose "Jacks tests not found"
86 # Jacks forces us to do this. You can't run it from a separate
88 verbose "Copying Jacks..."
89 catch {system "rm -rf jacks"}
90 catch {system "cp -r $srcdir/libjava.jacks/jacks jacks"}
95 verbose "Writing Jacks setup file"
96 gcj_jacks_write gcj_setup
98 verbose "Running Jacks..."
99 # Just ignore error exits from the jacks program.
100 # It will always error exit for us, since don't completely pass.
101 # At the moment jacks has a hardcoded call to tclsh8.3. To override this,
102 # we check here on the version and launch the script directly with the
104 set tcl_ver [info tclversion]
105 if {[package vcompare $tcl_ver 8.3] >= 0 } {
106 if {[catch {exec tclsh$tcl_ver jacks gcj} msg]} {
107 send_log "Couldn't run jacks: $msg\n"
110 gcj_jacks_parse logging/gcj.log
112 send_log "No suitable tclsh found, you need at least version 8.3 or up.\n"