This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA:] sim-defs.exp: support xfail


> Date: Wed, 10 Nov 2004 11:38:47 -0500
> From: Andrew Cagney <cagney@gnu.org>

> I can't think of a single reason for a simulator test that failing not 
> being for a known bug.
> 
> However, for consistency with dejagnu, we might as well support both. 
> Feel free to add the necessary glue to cover all of xfail and kfail and 
> kpass.

I felt free to the following, tested with dejagnu-1.4.4.
There's no separate kpass support (and no need for any, for the
same reason you don't need to add separate xpass support. :-)

	* lib/sim-defs.exp (run_sim_test): Support "xfail" and "kfail".
	In head comment, mention that output specifications concatenate.

Index: sim-defs.exp
===================================================================
RCS file: /cvs/src/src/sim/testsuite/lib/sim-defs.exp,v
retrieving revision 1.9
diff -c -p -r1.9 sim-defs.exp
*** sim-defs.exp	16 Nov 2004 07:06:17 -0000	1.9
--- sim-defs.exp	16 Nov 2004 16:12:10 -0000
*************** proc sim_run { prog sim_opts prog_opts r
*** 163,171 ****
--- 163,177 ----
  # 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-triplets-where-test-fails>
+ # kfail: <PRMS> <target-triplets-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
*************** proc run_sim_test { name requested_machs
*** 196,201 ****
--- 202,209 ----
      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 ""
*************** proc run_sim_test { name requested_machs
*** 233,238 ****
--- 241,251 ----
  	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
  	}
*************** proc run_sim_test { name requested_machs
*** 266,271 ****
--- 279,296 ----
  
  	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)
  	}

brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]