From patchwork Tue Jul 30 18:08:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Franco de Carvalho X-Patchwork-Id: 33860 Received: (qmail 13819 invoked by alias); 30 Jul 2019 18:09:58 -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 13810 invoked by uid 89); 30 Jul 2019 18:09:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=comparable, Carvalho, carvalho, HContent-Transfer-Encoding:8bit X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 30 Jul 2019 18:09:57 +0000 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x6UI6k3Q076813 for ; Tue, 30 Jul 2019 14:09:54 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2u2rmte09x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 30 Jul 2019 14:09:54 -0400 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x6UI7CGl078268 for ; Tue, 30 Jul 2019 14:09:54 -0400 Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0a-001b2d01.pphosted.com with ESMTP id 2u2rmte09a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Jul 2019 14:09:54 -0400 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x6UI4v0d004243; Tue, 30 Jul 2019 18:09:53 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma01wdc.us.ibm.com with ESMTP id 2u0e86fs15-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Jul 2019 18:09:53 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x6UI9qXu38273370 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Jul 2019 18:09:52 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 524D3AC060; Tue, 30 Jul 2019 18:09:52 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 25A24AC059; Tue, 30 Jul 2019 18:09:52 +0000 (GMT) Received: from pedro.localdomain (unknown [9.18.235.137]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 30 Jul 2019 18:09:52 +0000 (GMT) Received: by pedro.localdomain (Postfix, from userid 1000) id 204913C03F7; Tue, 30 Jul 2019 15:09:26 -0300 (-03) From: Pedro Franco de Carvalho To: gdb-patches@sourceware.org Cc: gbenson@redhat.com Subject: [PATCH] Remove directory names from gdb.base/batch-exit-status.exp Date: Tue, 30 Jul 2019 15:08:48 -0300 Message-Id: <20190730180848.16329-1-pedromfc@linux.ibm.com> MIME-Version: 1.0 Adjust gdb.base/batch-exit-status.exp so that test prefixes don't show directory names for the source scripts passed with -x, to make test results from different build directories comparable. gdb/testsuite/ChangeLog: YYYY-MM-DD Pedro Franco de Carvalho * gdb.base/batch-exit-status.exp: Call test_exit_status with prefix argument. (test_exit_status): Add prefix argument. --- gdb/testsuite/gdb.base/batch-exit-status.exp | 32 ++++++++++++-------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/gdb/testsuite/gdb.base/batch-exit-status.exp b/gdb/testsuite/gdb.base/batch-exit-status.exp index 6e434e4a14..0f89115571 100644 --- a/gdb/testsuite/gdb.base/batch-exit-status.exp +++ b/gdb/testsuite/gdb.base/batch-exit-status.exp @@ -43,28 +43,36 @@ proc _test_exit_status {expect_status cmdline_opts} { } } -proc test_exit_status {expect_status cmdline_opts} { - with_test_prefix $cmdline_opts { +proc test_exit_status {expect_status cmdline_opts prefix} { + if { $prefix == "" } { + set prefix $cmdline_opts + } + + with_test_prefix $prefix { _test_exit_status $expect_status $cmdline_opts } } # gdb -batch with nothing to do should exit 0. -test_exit_status 0 "-batch" +test_exit_status 0 "-batch" "" # Bad command-line options should cause exit 1. -test_exit_status 1 "-batch -jslkflsdjlkfjlksdjf" +test_exit_status 1 "-batch -jslkflsdjlkfjlksdjf" "" # gdb -batch with good commands should exit 0. -test_exit_status 0 "-batch -ex \"info source\"" -test_exit_status 0 "-batch -x $good_commands" +test_exit_status 0 "-batch -ex \"info source\"" "" +test_exit_status 0 "-batch -x $good_commands" "-batch -x good-commands" # gdb -batch with bad commands should exit 1. -test_exit_status 1 "-batch -ex \"set not-a-thing 4\"" -test_exit_status 1 "-batch -x $bad_commands" +test_exit_status 1 "-batch -ex \"set not-a-thing 4\"" "" +test_exit_status 1 "-batch -x $bad_commands" "-batch -x bad-commands" # Success or failure of the last thing determines the exit code. -test_exit_status 0 "-batch -ex \"set not-a-thing 4\" -x $good_commands" -test_exit_status 0 "-batch -x $bad_commands -ex \"info source\"" -test_exit_status 1 "-batch -x $good_commands -x $bad_commands" -test_exit_status 1 "-batch -x $good_commands -ex \"set not-a-thing 4\"" +test_exit_status 0 "-batch -ex \"set not-a-thing 4\" -x $good_commands" \ + "-batch -ex \"set not-a-thing 4\" -x good-commands" +test_exit_status 0 "-batch -x $bad_commands -ex \"info source\"" \ + "-batch -x bad-commands -ex \"info source\"" +test_exit_status 1 "-batch -x $good_commands -x $bad_commands" \ + "-batch -x good-commands -x bad-commands" +test_exit_status 1 "-batch -x $good_commands -ex \"set not-a-thing 4\"" \ + "-batch -x good-commands -ex \"set not-a-thing 4\""