From 6791ca54fb2a7c05bb095a694a036efa30fde500 Mon Sep 17 00:00:00 2001 From: tromey Date: Fri, 4 May 2001 19:33:10 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41840 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/testsuite/ChangeLog | 16 ++++++ libjava/testsuite/lib/libjava.exp | 63 ++++++++++++++++++---- libjava/testsuite/libjava.lang/Thread_Alive.xfail | 1 + .../testsuite/libjava.lang/Thread_Interrupt.xfail | 1 + libjava/testsuite/libjava.lang/Thread_Join.xfail | 1 + .../testsuite/libjava.lang/Thread_Monitor.xfail | 1 + libjava/testsuite/libjava.lang/Thread_Sleep.xfail | 1 + libjava/testsuite/libjava.lang/Thread_Wait.xfail | 1 + libjava/testsuite/libjava.lang/Thread_Wait_2.xfail | 1 + .../libjava.lang/Thread_Wait_Interrupt.xfail | 1 + 10 files changed, 78 insertions(+), 9 deletions(-) create mode 100644 libjava/testsuite/libjava.lang/Thread_Alive.xfail create mode 100644 libjava/testsuite/libjava.lang/Thread_Interrupt.xfail create mode 100644 libjava/testsuite/libjava.lang/Thread_Join.xfail create mode 100644 libjava/testsuite/libjava.lang/Thread_Monitor.xfail create mode 100644 libjava/testsuite/libjava.lang/Thread_Sleep.xfail create mode 100644 libjava/testsuite/libjava.lang/Thread_Wait.xfail create mode 100644 libjava/testsuite/libjava.lang/Thread_Wait_2.xfail create mode 100644 libjava/testsuite/libjava.lang/Thread_Wait_Interrupt.xfail diff --git a/libjava/testsuite/ChangeLog b/libjava/testsuite/ChangeLog index 5d1b051..c172cfb 100644 --- a/libjava/testsuite/ChangeLog +++ b/libjava/testsuite/ChangeLog @@ -1,5 +1,21 @@ 2001-05-03 Tom Tromey + * 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 + * libjava.lang/err11.xfail: Removed. 2001-04-25 Tom Tromey diff --git a/libjava/testsuite/lib/libjava.exp b/libjava/testsuite/lib/libjava.exp index 18a07e2..22ec065 100644 --- a/libjava/testsuite/lib/libjava.exp +++ b/libjava/testsuite/lib/libjava.exp @@ -107,11 +107,11 @@ set libjava_initialized 0 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; } @@ -127,6 +127,13 @@ proc libjava_init { args } { } } + # 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" @@ -331,6 +338,15 @@ proc test_libjava_from_source { options srcfile compile_args inpfile resultfile 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 @@ -376,7 +392,9 @@ proc test_libjava_from_source { options srcfile compile_args inpfile resultfile } 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" } @@ -388,8 +406,17 @@ proc test_libjava_from_source { options srcfile compile_args inpfile resultfile } 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 } @@ -464,6 +491,14 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e 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 @@ -489,7 +524,8 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e } 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" } @@ -521,7 +557,8 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e 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" } @@ -599,7 +636,8 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e 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" } @@ -608,6 +646,10 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e 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 } @@ -676,7 +718,10 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e # 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 diff --git a/libjava/testsuite/libjava.lang/Thread_Alive.xfail b/libjava/testsuite/libjava.lang/Thread_Alive.xfail new file mode 100644 index 0000000..3f95317 --- /dev/null +++ b/libjava/testsuite/libjava.lang/Thread_Alive.xfail @@ -0,0 +1 @@ +need-threads diff --git a/libjava/testsuite/libjava.lang/Thread_Interrupt.xfail b/libjava/testsuite/libjava.lang/Thread_Interrupt.xfail new file mode 100644 index 0000000..3f95317 --- /dev/null +++ b/libjava/testsuite/libjava.lang/Thread_Interrupt.xfail @@ -0,0 +1 @@ +need-threads diff --git a/libjava/testsuite/libjava.lang/Thread_Join.xfail b/libjava/testsuite/libjava.lang/Thread_Join.xfail new file mode 100644 index 0000000..3f95317 --- /dev/null +++ b/libjava/testsuite/libjava.lang/Thread_Join.xfail @@ -0,0 +1 @@ +need-threads diff --git a/libjava/testsuite/libjava.lang/Thread_Monitor.xfail b/libjava/testsuite/libjava.lang/Thread_Monitor.xfail new file mode 100644 index 0000000..3f95317 --- /dev/null +++ b/libjava/testsuite/libjava.lang/Thread_Monitor.xfail @@ -0,0 +1 @@ +need-threads diff --git a/libjava/testsuite/libjava.lang/Thread_Sleep.xfail b/libjava/testsuite/libjava.lang/Thread_Sleep.xfail new file mode 100644 index 0000000..3f95317 --- /dev/null +++ b/libjava/testsuite/libjava.lang/Thread_Sleep.xfail @@ -0,0 +1 @@ +need-threads diff --git a/libjava/testsuite/libjava.lang/Thread_Wait.xfail b/libjava/testsuite/libjava.lang/Thread_Wait.xfail new file mode 100644 index 0000000..3f95317 --- /dev/null +++ b/libjava/testsuite/libjava.lang/Thread_Wait.xfail @@ -0,0 +1 @@ +need-threads diff --git a/libjava/testsuite/libjava.lang/Thread_Wait_2.xfail b/libjava/testsuite/libjava.lang/Thread_Wait_2.xfail new file mode 100644 index 0000000..3f95317 --- /dev/null +++ b/libjava/testsuite/libjava.lang/Thread_Wait_2.xfail @@ -0,0 +1 @@ +need-threads diff --git a/libjava/testsuite/libjava.lang/Thread_Wait_Interrupt.xfail b/libjava/testsuite/libjava.lang/Thread_Wait_Interrupt.xfail new file mode 100644 index 0000000..3f95317 --- /dev/null +++ b/libjava/testsuite/libjava.lang/Thread_Wait_Interrupt.xfail @@ -0,0 +1 @@ +need-threads -- 2.7.4