* lib/sim-defs.exp (run_sim_test): Support "xfail" and "kfail".
authorHans-Peter Nilsson <hp@axis.com>
Tue, 16 Nov 2004 16:20:32 +0000 (16:20 +0000)
committerHans-Peter Nilsson <hp@axis.com>
Tue, 16 Nov 2004 16:20:32 +0000 (16:20 +0000)
sim/testsuite/ChangeLog
sim/testsuite/lib/sim-defs.exp

index 9c8b240..5fe75e1 100644 (file)
@@ -2,6 +2,7 @@
 
        * lib/sim-defs.exp (run_sim_test): Make multiple "output"
        specifications concatenate, not override.
+       Support "xfail" and "kfail".
 
 2004-10-26  Nick Clifton  <nickc@redhat.com>
 
index 5b7b1f2..a81706f 100644 (file)
@@ -163,9 +163,15 @@ proc sim_run { prog sim_opts prog_opts redir options } {
 # sim[(mach-list)]: <simulator options>
 # output: program output pattern to match with string-match
 # xerror: program is expected to return with a "failure" exit code
+# xfail: <PRMS-opt> <target-triples-where-test-fails>
+# kfail: <PRMS> <target-triples-where-test-fails>
 # If `output' is not specified, the program must output "pass" if !xerror or
 # "fail" if xerror.
 # The parens in "optname()" are optional if the specification is for all machs.
+# Multiple "output", "xfail" and "kfail" options concatenate.
+# The xfail and kfail arguments are space-separated target triplets and PRIDs.
+# There must be a PRMS (bug report ID) specified for kfail, while it's
+# optional for xfail.
 
 proc run_sim_test { name requested_machs } {
     global subdir srcdir
@@ -196,6 +202,8 @@ proc run_sim_test { name requested_machs } {
     set opts(mach) ""
     set opts(timeout) ""
     set opts(xerror) "no"
+    set opts(xfail) ""
+    set opts(kfail) ""
 
     if ![info exists global_as_options] {
         set global_as_options ""
@@ -233,6 +241,11 @@ proc run_sim_test { name requested_machs } {
        if { $opt_name == "output" } {
            set opt_val "$opts(output)$opt_val"
        }
+       # Similar with "xfail" and "kfail", but arguments are space-separated.
+       if { $opt_name == "xfail" || $opt_name == "kfail" } {
+           set opt_val "$opts($opt_name) $opt_val"
+       }
+
        foreach m $opt_machs {
            set opts($opt_name,$m) $opt_val
        }
@@ -266,6 +279,18 @@ proc run_sim_test { name requested_machs } {
 
        verbose -log "Testing $name on machine $mach."
 
+       # Time to setup xfailures and kfailures.
+       if { "$opts(xfail)" != "" } {
+           verbose -log "xfail: $opts(xfail)"
+           # Using eval to make $opts(xfail) appear as individual
+           # arguments.
+           eval setup_xfail $opts(xfail)
+       }
+       if { "$opts(kfail)" != "" } {
+           verbose -log "kfail: $opts(kfail)"
+           eval setup_kfail $opts(kfail)
+       }
+
        if ![info exists opts(as,$mach)] {
            set opts(as,$mach) $opts(as)
        }