Final.xfail: New file.
authorTom Tromey <tromey@cygnus.com>
Tue, 6 Jul 1999 15:38:09 +0000 (15:38 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Tue, 6 Jul 1999 15:38:09 +0000 (15:38 +0000)
* 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

libjava/testsuite/ChangeLog
libjava/testsuite/lib/libjava.exp
libjava/testsuite/libjava.compile/Case.xfail [new file with mode: 0644]
libjava/testsuite/libjava.compile/Where.xfail [new file with mode: 0644]
libjava/testsuite/libjava.compile/test.exp
libjava/testsuite/libjava.lang/Array_1.xfail [new file with mode: 0644]
libjava/testsuite/libjava.lang/Final.xfail [new file with mode: 0644]
libjava/testsuite/libjava.lang/test.exp

index 30f67d6ea1776dc59395840f36c7931cbdf423ad..3e9bbc591a0c2d5d7a05a1c95f2208e6e4fcefe9 100644 (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.
index 8c95fb3782ec5cdc69c29eadaf13c550b834f794..fd5ceb481ed47635dca6c7b0207ae65eed67fc95 100644 (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:
diff --git a/libjava/testsuite/libjava.compile/Case.xfail b/libjava/testsuite/libjava.compile/Case.xfail
new file mode 100644 (file)
index 0000000..755ab87
--- /dev/null
@@ -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 (file)
index 0000000..755ab87
--- /dev/null
@@ -0,0 +1 @@
+xfail-gcj
index db6aef19bb3021d89fa45a9d23f9a695fbf34b63..c76a58c5b0e22f04ee40727d0c36f9bba954f0eb 100644 (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:
diff --git a/libjava/testsuite/libjava.lang/Array_1.xfail b/libjava/testsuite/libjava.lang/Array_1.xfail
new file mode 100644 (file)
index 0000000..8e7b31e
--- /dev/null
@@ -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 (file)
index 0000000..eece641
--- /dev/null
@@ -0,0 +1 @@
+xfail-exec
index cfe9cf5069c07e54ae5144dea421b95202ca353b..c0b8570403f02225f8d89e08ff158afedb21eec1 100644 (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: