diff options
author | Tom Tromey <tromey@gcc.gnu.org> | 1999-07-06 15:46:05 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 1999-07-06 15:46:05 +0000 |
commit | 63c01cabeceeeacb137c26575245e833f0683c86 (patch) | |
tree | 3b9ced31149e4e712b2b3c9f4eef0fad634c3f72 | |
parent | fd7f0648b5064550d80807c107b85d748e25bb86 (diff) | |
download | gcc-63c01cabeceeeacb137c26575245e833f0683c86.zip gcc-63c01cabeceeeacb137c26575245e833f0683c86.tar.gz gcc-63c01cabeceeeacb137c26575245e833f0683c86.tar.bz2 |
[multiple changes]
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.
* libjava.lang/Final.out: Added.
From-SVN: r27960
-rw-r--r-- | libjava/testsuite/ChangeLog | 32 | ||||
-rw-r--r-- | libjava/testsuite/lib/libjava.exp | 114 | ||||
-rw-r--r-- | libjava/testsuite/libjava.compile/test.exp | 15 | ||||
-rw-r--r-- | libjava/testsuite/libjava.lang/test.exp | 35 |
4 files changed, 140 insertions, 56 deletions
diff --git a/libjava/testsuite/ChangeLog b/libjava/testsuite/ChangeLog index e39212e..3e9bbc5 100644 --- a/libjava/testsuite/ChangeLog +++ b/libjava/testsuite/ChangeLog @@ -1,3 +1,22 @@ +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. + * libjava.lang/Final.out: Added. + 1999-07-02 Tom Tromey <tromey@cygnus.com> * libjava.lang/Finalize_1.out: Removed. @@ -11,6 +30,19 @@ Thu Jul 1 16:22:19 1999 Anthony Green <green@cygnus.com> * libjava.mauve/mauve.exp: Don't stop counting test results prematurely. +1999-06-25 Tom Tromey <tromey@cygnus.com> + + * lib/libjava.exp (test_libjava_from_javac): Fixed typo. Always + make class_files a list. + + * lib/libjava.exp (test_libjava_from_javac): Prepend `$objdir/' to + class file names. + +1999-06-24 Tom Tromey <tromey@cygnus.com> + + * lib/libjava.exp (libjava_arguments): If `libtool' not found in + build tree, just use $GCJ_UNDER_TEST as compiler. + 1999-06-23 Tom Tromey <tromey@cygnus.com> * lib/libjava.exp (libjava_arguments): Handle -lzgcj. diff --git a/libjava/testsuite/lib/libjava.exp b/libjava/testsuite/lib/libjava.exp index 88691a86..fd5ceb4 100644 --- a/libjava/testsuite/lib/libjava.exp +++ b/libjava/testsuite/lib/libjava.exp @@ -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 {} { @@ -200,15 +211,20 @@ proc libjava_arguments {{mode compile}} { } # Search for libtool. We need it to link. + set found_compiler 0 set d [absolute $objdir] foreach x {. .. ../.. ../../..} { if {[file exists $d/$x/libtool]} then { # We have to run silently to avoid DejaGNU lossage. lappend args \ "compiler=$d/$x/libtool --silent --mode=$mode $GCJ_UNDER_TEST" + set found_compiler 1 break } } + if {! $found_compiler} { + lappend args "compiler=$GCJ_UNDER_TEST" + } return $args } @@ -216,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 @@ -229,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 @@ -248,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 "*-*-*" @@ -261,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; } @@ -300,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 { @@ -312,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 @@ -325,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 @@ -332,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 "*-*-*" @@ -361,17 +418,21 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e # nothing if the file contains an interface and not a class. I # believe this is a jv-scan bug. if {$class_out == ""} then { - set class_files [file rootname [file tail $srcfile]].class + set class_files \ + [list $objdir/[file rootname [file tail $srcfile]].class] } else { # Turn "a b" into "a.class b.class". - set class_files [join [split [string trim $class_out]] ".class "].class + set class_files {} + foreach file [split [string trim $class_out]] { + lappend class_files $objdir/$file.class + } } # Usually it is an error for a test program not to have a `main' # 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 { @@ -400,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" @@ -413,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 "*-*-*" @@ -443,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; @@ -464,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 @@ -480,3 +556,7 @@ proc default_libjava_version {} { proc default_libjava_start { } { } + +# Local Variables: +# tcl-indent-level:4 +# End: diff --git a/libjava/testsuite/libjava.compile/test.exp b/libjava/testsuite/libjava.compile/test.exp index db6aef1..6e1744a 100644 --- a/libjava/testsuite/libjava.compile/test.exp +++ b/libjava/testsuite/libjava.compile/test.exp @@ -1,10 +1,9 @@ -global srcdir subdir + set args [libjava_read_xfail [file rootname $x].xfail] + lappend args no-exec -catch "glob -nocomplain ${srcdir}/${subdir}/*.java" srcfiles -verbose "srcfiles are $srcfiles" + test_libjava $options "$x" "" "" "" $args + test_libjava $options "$x" "-O" "" "" $args -set prefix "" -foreach x $srcfiles { - test_libjava $options "$x" "" "" "" "no-exec" - test_libjava $options "$x" "-O" "" "" "no-exec" -} +# Local Variables: +# tcl-indent-level:4 +# End: diff --git a/libjava/testsuite/libjava.lang/test.exp b/libjava/testsuite/libjava.lang/test.exp index cfe9cf5..bc4cb38 100644 --- a/libjava/testsuite/libjava.lang/test.exp +++ b/libjava/testsuite/libjava.lang/test.exp @@ -1,34 +1,7 @@ -global srcdir subdir -catch "glob -nocomplain ${srcdir}/${subdir}/*.out" srcfiles -verbose "srcfiles are $srcfiles" + set args [libjava_read_xfail $srcdir/$subdir/$bname.xfail] -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" - } else { - set resfile "${prefix}.out" - set options "" - } - if [file exists ${prefix}.inp] { - set inpfile ${prefix}.inp - } else { - set inpfile "" - } - - 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: |