From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16840 invoked by alias); 16 Nov 2004 16:22:41 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 16763 invoked from network); 16 Nov 2004 16:22:33 -0000 Received: from unknown (HELO krynn.se.axis.com) (193.13.178.10) by sourceware.org with SMTP; 16 Nov 2004 16:22:33 -0000 Received: from ignucius.se.axis.com (ignucius.se.axis.com [10.83.5.18]) by krynn.se.axis.com (8.12.9/8.12.9/Debian-5local0.1) with ESMTP id iAGGMTAD008313; Tue, 16 Nov 2004 17:22:29 +0100 Received: from ignucius.se.axis.com (localhost [127.0.0.1]) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) with ESMTP id iAGGMTdD015835; Tue, 16 Nov 2004 17:22:29 +0100 Received: (from hp@localhost) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) id iAGGMTPv015831; Tue, 16 Nov 2004 17:22:29 +0100 Date: Tue, 16 Nov 2004 16:22:00 -0000 Message-Id: <200411161622.iAGGMTPv015831@ignucius.se.axis.com> From: Hans-Peter Nilsson To: cagney@gnu.org CC: hans-peter.nilsson@axis.com, gdb-patches@sources.redhat.com In-reply-to: <41924417.8060202@gnu.org> (message from Andrew Cagney on Wed, 10 Nov 2004 11:38:47 -0500) Subject: Re: [RFA:] sim-defs.exp: support xfail X-SW-Source: 2004-11/txt/msg00337.txt.bz2 > Date: Wed, 10 Nov 2004 11:38:47 -0500 > From: Andrew Cagney > 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)]: # 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 *************** 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