2002-11-06 02:02:19 +01:00
|
|
|
# Run the Jacks test suite.
|
|
|
|
# See http://www-124.ibm.com/developerworks/oss/cvs/jikes/~checkout~/jacks/jacks.html
|
|
|
|
|
2004-11-24 05:39:41 +01:00
|
|
|
proc load_gcc_lib { filename } {
|
|
|
|
global srcdir
|
|
|
|
load_file $srcdir/../../gcc/testsuite/lib/$filename
|
|
|
|
}
|
|
|
|
|
|
|
|
load_gcc_lib target-libpath.exp
|
|
|
|
|
2002-12-02 00:50:03 +01:00
|
|
|
proc gcj_jacks_setup_xfail {ary} {
|
|
|
|
upvar $ary array
|
|
|
|
global srcdir
|
|
|
|
|
|
|
|
set fd [open $srcdir/libjava.jacks/jacks.xfail]
|
|
|
|
while {! [eof $fd]} {
|
|
|
|
set array([gets $fd]) {}
|
|
|
|
}
|
|
|
|
close $fd
|
|
|
|
}
|
|
|
|
|
2002-11-06 02:02:19 +01:00
|
|
|
proc gcj_jacks_write {filename} {
|
|
|
|
global GCJ_UNDER_TEST
|
2003-02-03 17:20:30 +01:00
|
|
|
global libgcj_jar
|
|
|
|
global libjava_libgcc_s_path
|
2004-11-24 05:39:41 +01:00
|
|
|
global ld_library_path
|
2002-11-06 02:02:19 +01:00
|
|
|
|
|
|
|
set gcjl [split $GCJ_UNDER_TEST]
|
|
|
|
set gcj_cmd [lindex $gcjl 0]
|
|
|
|
set rest [join [lreplace $gcjl 0 0]]
|
|
|
|
append rest " -C"
|
|
|
|
|
|
|
|
set fd [open $filename w]
|
|
|
|
puts $fd "set JAVAC $gcj_cmd"
|
2003-02-03 17:20:30 +01:00
|
|
|
puts $fd "set JAVA_CLASSPATH \"$libgcj_jar\""
|
2002-11-06 02:02:19 +01:00
|
|
|
puts $fd "set JAVAC_FLAGS [list $rest]"
|
|
|
|
puts $fd "set JAVA [list [libjava_find_gij]]"
|
2004-04-25 06:19:13 +02:00
|
|
|
|
|
|
|
# Without an explicit limit on the heap size, tests depending on
|
|
|
|
# an OutOfMemoryError (e.g. "15.9.4-runtime-creation-2") can result
|
|
|
|
# in a lot of unnecessary thrashing.
|
|
|
|
puts $fd "set JAVA_FLAGS \"-mx=64m\""
|
|
|
|
|
2002-11-06 02:02:19 +01:00
|
|
|
puts $fd "set JAVAC_ENCODING_FLAG --encoding="
|
2004-07-14 22:45:55 +02:00
|
|
|
puts $fd "set JAVAC_DEPRECATION_FLAG -Wdeprecated"
|
2002-11-06 02:02:19 +01:00
|
|
|
puts $fd "set tcltest::testConstraints(encoding) 1"
|
|
|
|
puts $fd "set tcltest::testConstraints(gcj) 1"
|
2003-11-11 21:04:22 +01:00
|
|
|
puts $fd "set tcltest::testConstraints(assert) 1"
|
2002-11-06 02:02:19 +01:00
|
|
|
# "Time-consuming JVM limitation tests".
|
|
|
|
# puts $fd "set tcltest::testConstraints(jvm) 1"
|
|
|
|
close $fd
|
2003-02-03 17:20:30 +01:00
|
|
|
|
2004-11-24 05:39:41 +01:00
|
|
|
set ld_library_path $libjava_libgcc_s_path
|
|
|
|
set_ld_library_path_env_vars
|
2002-11-06 02:02:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
proc gcj_jacks_parse {file} {
|
|
|
|
if {[catch {open $file} fd]} {
|
|
|
|
verbose "couldn't parse Jacks output: $fd"
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2002-12-02 00:50:03 +01:00
|
|
|
verbose "Reading jacks.xfail"
|
|
|
|
gcj_jacks_setup_xfail xfails
|
|
|
|
|
2002-11-06 02:02:19 +01:00
|
|
|
while {! [eof $fd]} {
|
|
|
|
set line [gets $fd]
|
|
|
|
if {[string match RESULT* $line]} {
|
|
|
|
set linelist [split $line]
|
2002-12-02 00:50:03 +01:00
|
|
|
set test [lindex $linelist 1]
|
|
|
|
if {[info exists xfails($test)]} {
|
|
|
|
setup_xfail "*-*-*"
|
|
|
|
}
|
2002-11-06 02:02:19 +01:00
|
|
|
if {[lindex $linelist 2] == "PASSED"} {
|
2002-12-02 00:50:03 +01:00
|
|
|
pass $test
|
2002-11-06 02:02:19 +01:00
|
|
|
} else {
|
2002-12-02 00:50:03 +01:00
|
|
|
fail $test
|
2002-11-06 02:02:19 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
close $fd
|
|
|
|
}
|
|
|
|
|
|
|
|
proc gcj_jacks_run {} {
|
|
|
|
global srcdir
|
|
|
|
|
|
|
|
if {! [file isdirectory $srcdir/libjava.jacks/jacks]} {
|
|
|
|
# No tests.
|
|
|
|
verbose "Jacks tests not found"
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
# Jacks forces us to do this. You can't run it from a separate
|
|
|
|
# tree.
|
|
|
|
verbose "Copying Jacks..."
|
|
|
|
catch {system "rm -rf jacks"}
|
|
|
|
catch {system "cp -r $srcdir/libjava.jacks/jacks jacks"}
|
|
|
|
|
|
|
|
set here [pwd]
|
|
|
|
cd jacks
|
|
|
|
|
|
|
|
verbose "Writing Jacks setup file"
|
|
|
|
gcj_jacks_write gcj_setup
|
|
|
|
|
|
|
|
verbose "Running Jacks..."
|
2003-08-05 00:07:06 +02:00
|
|
|
# Just ignore error exits from the jacks program.
|
|
|
|
# It will always error exit for us, since don't completely pass.
|
2004-07-14 22:45:55 +02:00
|
|
|
# At the moment jacks has a hardcoded call to tclsh8.3. To override this,
|
|
|
|
# we check here on the version and launch the script directly with the
|
|
|
|
# tclsh$tcl_ver.
|
|
|
|
set tcl_ver [info tclversion]
|
|
|
|
if {[package vcompare $tcl_ver 8.3] >= 0 } {
|
|
|
|
if {[catch {exec tclsh$tcl_ver jacks gcj} msg]} {
|
|
|
|
send_log "Couldn't run jacks: $msg\n"
|
|
|
|
return
|
|
|
|
}
|
|
|
|
gcj_jacks_parse logging/gcj.log
|
|
|
|
} else {
|
|
|
|
send_log "No suitable tclsh found, you need at least version 8.3 or up.\n"
|
|
|
|
return
|
|
|
|
}
|
2002-11-06 02:02:19 +01:00
|
|
|
|
|
|
|
cd $here
|
|
|
|
}
|
|
|
|
|
|
|
|
gcj_jacks_run
|