From 310ca70ce2bc8fa62519b849106a3eb95e2d7b36 Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Tue, 16 Nov 2004 16:20:32 +0000 Subject: [PATCH] * lib/sim-defs.exp (run_sim_test): Support "xfail" and "kfail". --- sim/testsuite/ChangeLog | 1 + sim/testsuite/lib/sim-defs.exp | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/sim/testsuite/ChangeLog b/sim/testsuite/ChangeLog index 9c8b240..5fe75e1 100644 --- a/sim/testsuite/ChangeLog +++ b/sim/testsuite/ChangeLog @@ -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 diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp index 5b7b1f2..a81706f 100644 --- a/sim/testsuite/lib/sim-defs.exp +++ b/sim/testsuite/lib/sim-defs.exp @@ -163,9 +163,15 @@ proc sim_run { prog sim_opts prog_opts redir options } { # sim[(mach-list)]: # output: program output pattern to match with string-match # xerror: program is expected to return with a "failure" exit code +# xfail: +# kfail: # 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) } -- 2.7.4