From patchwork Mon Mar 2 20:11:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 5418 Received: (qmail 36685 invoked by alias); 2 Mar 2015 20:11:37 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 36622 invoked by uid 89); 2 Mar 2015 20:11:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD 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; Mon, 02 Mar 2015 20:11:36 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t22KBYxH019482 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 2 Mar 2015 15:11:34 -0500 Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t22KBXeg027873 for ; Mon, 2 Mar 2015 15:11:34 -0500 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [pushed] gdb_test_multiple: return -1 on internal error Date: Mon, 2 Mar 2015 20:11:33 +0000 Message-Id: <1425327093-406-1-git-send-email-palves@redhat.com> gdb_test_multiple is supposed to return -1 on internal error: # Returns: # 1 if the test failed, according to a built-in failure pattern # 0 if only user-supplied patterns matched # -1 if there was an internal error. But alas, that's broken, it returns success... It looks like the code is assuming an earlier 'set result -1' is still in effect, but 'result' is set to 0 at the end, just before we call gdb_expect: set result 0 set code [catch {gdb_expect $code} string] gdb/testsuite/ 2015-03-02 Pedro Alves * lib/gdb.exp (gdb_test_multiple) : Set result to -1. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/lib/gdb.exp | 1 + 2 files changed, 6 insertions(+) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 880e674..76ed5e2 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-02 Pedro Alves + + * lib/gdb.exp (gdb_test_multiple) : Set result to + -1. + 2015-03-02 Andreas Arnez * gdb.arch/s390-vregs.exp: New test. diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 08db806..f274b64 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -808,6 +808,7 @@ proc gdb_test_multiple { command message user_code } { -re ".*A problem internal to GDB has been detected" { fail "$message (GDB internal error)" gdb_internal_error_resync + set result -1 } -re "\\*\\*\\* DOSEXIT code.*" { if { $message != "" } {