From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101764 invoked by alias); 24 Jun 2015 11:25:52 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 101728 invoked by uid 89); 24 Jun 2015 11:25:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 24 Jun 2015 11:25:49 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 50EBEB7A8C; Wed, 24 Jun 2015 11:25:48 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5OBPkng029441; Wed, 24 Jun 2015 07:25:47 -0400 Message-ID: <558A93BA.4030205@redhat.com> Date: Wed, 24 Jun 2015 11:25:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Mike Frysinger , gdb-patches@sourceware.org Subject: Re: [PATCH] gdb: tests: mark async unsupported dynamically References: <1434770234-24916-1-git-send-email-vapier@gentoo.org> In-Reply-To: <1434770234-24916-1-git-send-email-vapier@gentoo.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-06/txt/msg00519.txt.bz2 On 06/20/2015 04:17 AM, Mike Frysinger wrote: > There are many targets which do not support asynchronous execution. > Rather than having the async tests mark them as FAIL, use UNSUPPORTED > as that better represents the state. > --- > 2015-06-19 Mike Frysinger > > * gdb.base/async.exp (test_background): Call unsupported when async > isn't supported. > > gdb/testsuite/gdb.base/async.exp | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/gdb/testsuite/gdb.base/async.exp b/gdb/testsuite/gdb.base/async.exp > index 2d3fb73..4b9168a 100644 > --- a/gdb/testsuite/gdb.base/async.exp > +++ b/gdb/testsuite/gdb.base/async.exp > @@ -58,6 +58,9 @@ proc test_background {command before_prompt after_prompt {message ""}} { > -re "^$command\r\n${before_prompt}${gdb_prompt}${after_prompt}completed\.\r\n" { > pass "$message" > } > + -re "Asynchronous execution not supported on this target\.\r\n" { > + unsupported "$message" > + } > -re "$gdb_prompt.*completed\.\r\n" { > fail "$message" > } > We should also return something that the caller checks to bail the rest of the file. Otherwise, as soon as we add something to the test that expects that e.g., "print foo" returns some value after the previous async commands worked, that test will fail on sync targets. Something like: send_gdb "$command\n" gdb_expect { -re "^$command\r\n${before_prompt}${gdb_prompt}${after_prompt}completed\.\r\n" { pass "$message" + return 0 } -re "$gdb_prompt.*completed\.\r\n" { fail "$message" } timeout { fail "$message (timeout)" } } + return -1 } and: -test_background "next&" "" ".*z = 9.*" +if {[test_background "next&" "" ".*z = 9.*"] < 0} { + return +} ... rest unchanged ... Thanks, Pedro Alves