aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
Diffstat (limited to 'libjava')
-rw-r--r--libjava/testsuite/ChangeLog14
-rw-r--r--libjava/testsuite/lib/libjava.exp101
-rw-r--r--libjava/testsuite/libjava.compile/Case.xfail1
-rw-r--r--libjava/testsuite/libjava.compile/Where.xfail1
-rw-r--r--libjava/testsuite/libjava.compile/test.exp11
-rw-r--r--libjava/testsuite/libjava.lang/Array_1.xfail1
-rw-r--r--libjava/testsuite/libjava.lang/Final.xfail1
-rw-r--r--libjava/testsuite/libjava.lang/test.exp13
8 files changed, 120 insertions, 23 deletions
diff --git a/libjava/testsuite/ChangeLog b/libjava/testsuite/ChangeLog
index 30f67d6..3e9bbc5 100644
--- a/libjava/testsuite/ChangeLog
+++ b/libjava/testsuite/ChangeLog
@@ -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.
diff --git a/libjava/testsuite/lib/libjava.exp b/libjava/testsuite/lib/libjava.exp
index 8c95fb3..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 {} {
@@ -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:
diff --git a/libjava/testsuite/libjava.compile/Case.xfail b/libjava/testsuite/libjava.compile/Case.xfail
new file mode 100644
index 0000000..755ab87
--- /dev/null
+++ b/libjava/testsuite/libjava.compile/Case.xfail
@@ -0,0 +1 @@
+xfail-gcj
diff --git a/libjava/testsuite/libjava.compile/Where.xfail b/libjava/testsuite/libjava.compile/Where.xfail
new file mode 100644
index 0000000..755ab87
--- /dev/null
+++ b/libjava/testsuite/libjava.compile/Where.xfail
@@ -0,0 +1 @@
+xfail-gcj
diff --git a/libjava/testsuite/libjava.compile/test.exp b/libjava/testsuite/libjava.compile/test.exp
index db6aef1..c76a58c 100644
--- a/libjava/testsuite/libjava.compile/test.exp
+++ b/libjava/testsuite/libjava.compile/test.exp
@@ -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:
diff --git a/libjava/testsuite/libjava.lang/Array_1.xfail b/libjava/testsuite/libjava.lang/Array_1.xfail
new file mode 100644
index 0000000..8e7b31e
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/Array_1.xfail
@@ -0,0 +1 @@
+xfail-gcj xfail-exec
diff --git a/libjava/testsuite/libjava.lang/Final.xfail b/libjava/testsuite/libjava.lang/Final.xfail
new file mode 100644
index 0000000..eece641
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/Final.xfail
@@ -0,0 +1 @@
+xfail-exec
diff --git a/libjava/testsuite/libjava.lang/test.exp b/libjava/testsuite/libjava.lang/test.exp
index cfe9cf5..c0b8570 100644
--- a/libjava/testsuite/libjava.lang/test.exp
+++ b/libjava/testsuite/libjava.lang/test.exp
@@ -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: