Final.xfail: New file.

* libjava.lang/Final.xfail: New file.
	* libjava.compile/Case.xfail: New file.
	* libjava.compile/Where.xfail: New file.
	* libjava.compile/test.exp: Look for `.xfail' files.
	* libjava.lang/test.exp: Don't look for `.arg' files.
	Do look for `.xfail' files.
	* lib/libjava.exp (test_libjava_from_source): Changed meaning of
	`exec_args' argument.  Handle `xfail-*' arguments.
	(test_libjava_from_javac): Likewise.
	(test_libjava): Likewise.
	(libjava_read_xfail): New proc.

From-SVN: r27957
This commit is contained in:
Tom Tromey 1999-07-06 15:38:09 +00:00 committed by Tom Tromey
parent 693a61283b
commit f3d4f6f9a8
8 changed files with 120 additions and 23 deletions

View File

@ -1,3 +1,17 @@
1999-07-06 Tom Tromey <tromey@cygnus.com>
* libjava.lang/Final.xfail: New file.
* libjava.compile/Case.xfail: New file.
* libjava.compile/Where.xfail: New file.
* libjava.compile/test.exp: Look for `.xfail' files.
* libjava.lang/test.exp: Don't look for `.arg' files.
Do look for `.xfail' files.
* lib/libjava.exp (test_libjava_from_source): Changed meaning of
`exec_args' argument. Handle `xfail-*' arguments.
(test_libjava_from_javac): Likewise.
(test_libjava): Likewise.
(libjava_read_xfail): New proc.
1999-07-05 Bryce McKinlay <bryce@albatross.co.nz>
* libjava.lang/Final.java: Added.

View File

@ -10,6 +10,17 @@ if ![info exists tmpdir] {
set tmpdir "/tmp"
}
# Read an `xfail' file if it exists. Returns a list of xfail tokens.
proc libjava_read_xfail {file} {
if {! [file exists $file]} {
return ""
}
set fd [open $file r]
set tokens [string trim [read $fd]]
close $fd
return $tokens
}
# Find `jv-scan'. FIXME: this relies on DejaGnu internals. These
# should probably be exposed in a better way.
proc find_jvscan {} {
@ -221,8 +232,15 @@ proc libjava_arguments {{mode compile}} {
#
# Run the test specified by srcfile and resultfile. compile_args and
# exec_args are additional arguments to be passed in when compiling and
# running the testcase, respectively.
# exec_args are options telling this proc how to work.
# `no-exec' don't try to run the test
# `xfail-gcj' compilation from source will fail
# `xfail-javac' compilation with javac will fail
# `xfail-gcjC' compilation with gcj -C will fail
# `xfail-byte' compilation from bytecode will fail
# `xfail-exec' exec will fail
# `xfail-output' output will be wrong
#
#
proc test_libjava_from_source { options srcfile compile_args inpfile resultfile exec_args } {
global base_dir
@ -234,6 +252,13 @@ proc test_libjava_from_source { options srcfile compile_args inpfile resultfile
global tmpdir
global runtests
# Make opts into an array.
set opts(_) x
unset opts(_)
foreach item $exec_args {
set opts($item) x
}
set errname [file rootname [file tail $srcfile]]
if {! [runtest_file_p $runtests $errname]} {
return
@ -253,10 +278,13 @@ proc test_libjava_from_source { options srcfile compile_args inpfile resultfile
}
set x [target_compile $srcfile "$executable" executable $args]
if {[info exists opts(xfail-gcj)]} {
setup_xfail *-*-*
}
if { $x != "" } {
verbose "target_compile failed: $x" 2
fail "$errname compilation from source"
if {$exec_args != "no-exec"} {
if {[info exists opts(xfail-gcj)] || ! [info exists opts(no-exec)]} {
setup_xfail "*-*-*"
fail "$errname execution from source compiled test"
setup_xfail "*-*-*"
@ -266,17 +294,20 @@ proc test_libjava_from_source { options srcfile compile_args inpfile resultfile
}
pass "$errname compilation from source"
if { $exec_args == "no-exec" } {
if {[info exists opts(no-exec)]} {
return
}
set result [libjava_load $executable "$exec_args" "$inpfile"];
set result [libjava_load $executable "" "$inpfile"];
set status [lindex $result 0];
set output [lindex $result 1];
if {[info exists opts(xfail-exec)]} then {
setup_xfail *-*-*
}
$status "$errname execution from source compiled test"
if { $status != "pass" } {
setup_xfail "*-*-*"
fail "$errname output from source compiled test"
fail "$errname execution from source compiled test"
return;
}
@ -305,6 +336,9 @@ proc test_libjava_from_source { options srcfile compile_args inpfile resultfile
set passed 1;
}
}
if {[info exists opts(xfail-output)]} {
setup_xfail *-*-*
}
if { $passed == 1 } {
pass "$errname output from source compiled test"
} else {
@ -317,8 +351,14 @@ proc test_libjava_from_source { options srcfile compile_args inpfile resultfile
#
# Run the test specified by srcfile and resultfile. compile_args and
# exec_args are additional arguments to be passed in when compiling and
# running the testcase, respectively.
# exec_args are options telling this proc how to work.
# `no-exec' don't try to run the test
# `xfail-gcj' compilation from source will fail
# `xfail-javac' compilation with javac will fail
# `xfail-gcjC' compilation with gcj -C will fail
# `xfail-byte' compilation from bytecode will fail
# `xfail-exec' exec will fail
# `xfail-output' output will be wrong
#
proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile exec_args } {
global base_dir
@ -330,6 +370,13 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
global tmpdir
global runtests
# Make opts into an array.
set opts(_) x
unset opts(_)
foreach item $exec_args {
set opts($item) x
}
set errname [file rootname [file tail $srcfile]]
if {! [runtest_file_p $runtests $errname]} {
return
@ -337,11 +384,16 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
# bytecompile files with Sun's compiler for now.
set bc_ok [bytecompile_file $srcfile $objdir]
# FIXME: assumes we are using javac to compile to bytecode.
# This is not always the case.
if {[info exists opts(xfail-javac)]} {
setup_xfail *-*-*
}
if {! $bc_ok} then {
fail "$errname byte compilation"
setup_xfail "*-*-*"
fail "$errname compilation from bytecode"
if {$exec_args != "no-exec"} {
if {! [info exists opts(no-exec)]} {
setup_xfail "*-*-*"
fail "$errname execution from bytecode->native test"
setup_xfail "*-*-*"
@ -380,7 +432,7 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
# method. However, for no-exec tests it is ok.
set largs {}
if {$main_name == ""} {
if {$exec_args != "no-exec"} {
if {! [info exists opts(no-exec)]} {
perror "No `main' given in program $errname"
return
} else {
@ -409,11 +461,14 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
verbose "compilation command = $args" 2
set x [target_compile $class_files "$executable" $type $args]
if {[info exists opts(xfail-byte)]} {
setup_xfail *-*-*
}
if { $x != "" } {
verbose "target_compile failed: $x" 2
fail "$errname compilation from bytecode"
setup_xfail "*-*-*"
if {$exec_args != "no-exec"} {
if {! [info exists opts(no-exec)]} {
fail "$errname execution from bytecode->native test"
setup_xfail "*-*-*"
fail "$errname output from bytecode->native test"
@ -422,13 +477,16 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
}
pass "$errname compilation from bytecode"
if { $exec_args == "no-exec" } {
if {[info exists opts(no-exec)]} {
return
}
set result [libjava_load $executable "$exec_args" "$inpfile"];
set result [libjava_load $executable "" "$inpfile"];
set status [lindex $result 0];
set output [lindex $result 1];
if {[info exists opts(xfail-exec)]} {
setup_xfail *-*-*
}
$status "$errname execution from bytecode->native test"
if { $status != "pass" } {
setup_xfail "*-*-*"
@ -452,6 +510,9 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
verbose "expected is $expected"
verbose "actual is $output"
set passed 0;
if {[info exists opts(xfail-output)]} {
setup_xfail *-*-*
}
if {$options == "regexp_match"} {
if [regexp $expected $output] {
set passed 1;
@ -473,8 +534,14 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
#
# Run the test specified by srcfile and resultfile. compile_args and
# exec_args are additional arguments to be passed in when compiling and
# running the testcase, respectively.
# exec_args are options telling this proc how to work.
# `no-exec' don't try to run the test
# `xfail-gcj' compilation from source will fail
# `xfail-javac' compilation with javac will fail
# `xfail-gcjC' compilation with gcj -C will fail
# `xfail-byte' compilation from bytecode will fail
# `xfail-exec' exec will fail
# `xfail-output' output will be wrong
#
proc test_libjava { options srcfile compile_args inpfile resultfile exec_args } {
test_libjava_from_source $options $srcfile $compile_args $inpfile $resultfile $exec_args
@ -489,3 +556,7 @@ proc default_libjava_version {} {
proc default_libjava_start { } {
}
# Local Variables:
# tcl-indent-level:4
# End:

View File

@ -0,0 +1 @@
xfail-gcj

View File

@ -0,0 +1 @@
xfail-gcj

View File

@ -5,6 +5,13 @@ verbose "srcfiles are $srcfiles"
set prefix ""
foreach x $srcfiles {
test_libjava $options "$x" "" "" "" "no-exec"
test_libjava $options "$x" "-O" "" "" "no-exec"
set args [libjava_read_xfail [file rootname $x].xfail]
lappend args no-exec
test_libjava $options "$x" "" "" "" $args
test_libjava $options "$x" "-O" "" "" $args
}
# Local Variables:
# tcl-indent-level:4
# End:

View File

@ -0,0 +1 @@
xfail-gcj xfail-exec

View File

@ -0,0 +1 @@
xfail-exec

View File

@ -7,12 +7,7 @@ set prefix ""
foreach x $srcfiles {
regsub "\\.out$" $x "" prefix
set bname [file tail $prefix]
set args ""
if [file exists $srcdir/$subdir/${bname}.arg] {
set id [open "$srcdir/$subdir/${bname}.arg" r];
set args [read -nonewline $id];
close $id;
}
if [file exists $srcdir/$subdir/${bname}.xpo] {
set resfile "$srcdir/$subdir/${bname}.xpo"
set options "regexp_match"
@ -27,8 +22,14 @@ foreach x $srcfiles {
set inpfile ""
}
set args [libjava_read_xfail $srcdir/$subdir/$bname.xfail]
verbose "inpfile is $inpfile"
test_libjava $options "${prefix}.java" "" $inpfile $resfile $args
test_libjava $options "${prefix}.java" "-O" $inpfile $resfile $args
}
# Local Variables:
# tcl-indent-level:4
# End: