+2001-05-03 Tom Tromey <tromey@redhat.com>
+
+ * libjava.lang/Thread_Wait_Interrupt.xfail: New file.
+ * libjava.lang/Thread_Wait_2.xfail: New file.
+ * libjava.lang/Thread_Wait.xfail: New file.
+ * libjava.lang/Thread_Sleep.xfail: New file.
+ * libjava.lang/Thread_Monitor.xfail: New file.
+ * libjava.lang/Thread_Join.xfail: New file.
+ * libjava.lang/Thread_Interrupt.xfail: New file.
+ * libjava.lang/Thread_Alive.xfail: New file.
+ * lib/libjava.exp (libjava_init): Set global
+ libjava_uses_threads.
+ (test_libjava): Document `need-threads' tag.
+ (test_libjava_from_source): handle need-threads tag.
+ (test_libjava_from_javac): Likewise.
+
2001-05-03 Tom Tromey <tromey@redhat.com>
* libjava.lang/err11.xfail: Removed.
proc libjava_init { args } {
global wrapper_file;
global wrap_compile_flags;
- global libjava_initialized
+ global libjava_initialized libjava_uses_threads
global GCJ_UNDER_TEST
global TOOL_EXECUTABLE
global original_ld_library_path
- global env
+ global env objdir
if { $libjava_initialized == 1 } { return; }
}
}
+ # The -B is so we find libgcj.spec.
+ set text [eval exec "$GCJ_UNDER_TEST -B$objdir/../ -v 2>@ stdout"]
+ regexp -- "Thread model: (\[^\n\]+)\n" $text ignore model
+ set libjava_uses_threads [expr {! ($model == "no"
+ || $model == "none"
+ || $model == "single")}]
+
# Always set encoding used by gcj.
append GCJ_UNDER_TEST " --encoding=UTF-8"
set opts($item) x
}
+ # If we need threads and we don't have them then set the `no-exec'
+ # flag. This is case is also handled specially later.
+ if {[info exists opts(need-threads)]} {
+ global libjava_uses_threads
+ if {! $libjava_uses_threads} {
+ set opts(no-exec) x
+ }
+ }
+
set errname [file rootname [file tail $srcfile]]
if {! [runtest_file_p $runtests $errname]} {
return
}
fail "$errname compilation from source"
- if {[info exists opts(xfail-gcj)] || ! [info exists opts(no-exec)]} {
+ if {[info exists opts(xfail-gcj)]
+ || ! [info exists opts(no-exec)]
+ || [info exists opts(need-threads)]} {
untested "$errname execution from source compiled test"
untested "$errname output from source compiled test"
}
}
pass "$errname compilation from source"
- if {[info exists opts(no-exec)]
- || [info exists opts(no-link)]} {
+ if {[info exists opts(no-exec)]} {
+ if {[info exists opts(need-threads)]} {
+ # This means we wanted to try to run it but we couldn't
+ # because threads aren't supported. So we have to
+ # generate an `untested'.
+ untested "$errname execution from source compiled test"
+ untested "$errname output from source compiled test"
+ }
+ return
+ }
+ if {[info exists opts(no-link)]} {
return
}
set opts($item) x
}
+ # If we need threads and we don't have them then set the `no-exec'
+ # flag. This is case is also handled specially later.
+ if {[info exists opts(need-threads)]} {
+ global libjava_uses_threads
+ if {! $libjava_uses_threads} {
+ set opts(no-exec) x
+ }
+ }
set errname [file rootname [file tail $srcfile]]
if {! [runtest_file_p $runtests $errname]} {
return
}
fail "$errname byte compilation"
untested "$errname compilation from bytecode"
- if {! [info exists opts(no-exec)]} {
+ if {! [info exists opts(no-exec)]
+ || [info exists opts(need-threads)]} {
untested "$errname execution from bytecode->native test"
untested "$errname output from bytecode->native test"
}
if {[string match "*parse error*" $main_name]
|| [string match "*parse error*" $class_out]} {
untested "$errname compilation from bytecode"
- if {! [info exists opts(no-exec)]} {
+ if {! [info exists opts(no-exec)]
+ || [info exists opts(need-threads)]} {
untested "$errname execution from bytecode->native test"
untested "$errname output from bytecode->native test"
}
if { $x != "" } {
verbose "target_compile failed: $x" 2
fail "$errname compilation from bytecode"
- if {! [info exists opts(no-exec)]} {
+ if {! [info exists opts(no-exec)]
+ || [info exists opts(need-threads)]} {
untested "$errname execution from bytecode->native test"
untested "$errname output from bytecode->native test"
}
pass "$errname compilation from bytecode"
if {[info exists opts(no-exec)]} {
+ if {[info exists opts(need-threads)]} {
+ untested "$errname execution from bytecode->native test"
+ untested "$errname output from bytecode->native test"
+ }
return
}
# front end.
# `xfail-byte' compilation from bytecode will fail
# `xfail-exec' exec will fail
-# `xfail-output' output will be wrong
+# `xfail-output'
+# output will be wrong
+# `need-threads'
+# test relies on thread support
#
proc test_libjava { options srcfile compile_args inpfile resultfile exec_args } {
test_libjava_from_source $options $srcfile $compile_args $inpfile $resultfile $exec_args