From patchwork Thu Sep 20 02:18:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 29486 Received: (qmail 6627 invoked by alias); 20 Sep 2018 02:18:21 -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 6441 invoked by uid 89); 20 Sep 2018 02:18:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:0700 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 20 Sep 2018 02:18:18 +0000 Received: from svr-orw-mbx-03.mgc.mentorg.com ([147.34.90.203]) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1g2oXo-0005mx-Dg from Sandra_Loosemore@mentor.com ; Wed, 19 Sep 2018 19:18:16 -0700 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Wed, 19 Sep 2018 19:18:13 -0700 Subject: Re: [patch, testsuite] skip tab-completion tests if no readline To: Tom Tromey CC: "gdb-patches@sourceware.org" References: <87o9ctr6gq.fsf@tromey.com> From: Sandra Loosemore Message-ID: <59f69846-1899-05b8-57b4-87124a166121@codesourcery.com> Date: Wed, 19 Sep 2018 20:18:11 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <87o9ctr6gq.fsf@tromey.com> On 09/19/2018 06:56 AM, Tom Tromey wrote: > [snip] > > Perhaps the early returns should call "untested". I'm on the fence > about this, sometimes it is done, sometimes not. I don't know if it > matters to anybody -- I never really look at these lines. > > https://sourceware.org/gdb/wiki/GDBTestcaseCookbook#A.22untested.22_calls > > Second, this particular check runs early. I wonder if readline_is_used > actually works at this spot, because I would imagine gdb isn't running yet. > What does "runtest cpls-ops.exp" do? Ooops, my bad. :-( I'd checked that the failures went away, but hadn't looked closely at the logs to see that it was complaining about an error there. I've fixed it by moving the check after gdb is started, and also added the "untested" calls. This is the version of the patch I've checked in. -Sandra commit 4ee9b0c53a8055b869dfe424846bc00eb0cd0c8f Author: Sandra Loosemore Date: Wed Sep 19 19:05:39 2018 -0700 Skip GDB tab-completion tests if no readline. 2018-09-18 Sandra Loosemore gdb/testsuite/ * gdb.base/complete-empty.exp: Skip tab-completion tests if no readline. * gdb.base/utf8-identifiers.exp: Likewise. * gdb.cp/cpcompletion.exp: Likewise. * gdb.linespec/cpcompletion.exp: Likewise. * gdb.linespec/cpls-abi-tag.exp: Likewise. * gdb.linespec/cpls-ops.exp: Likewise. diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 37f252e..53173c2 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2018-09-18 Sandra Loosemore + + * gdb.base/complete-empty.exp: Skip tab-completion tests if + no readline. + * gdb.base/utf8-identifiers.exp: Likewise. + * gdb.cp/cpcompletion.exp: Likewise. + * gdb.linespec/cpcompletion.exp: Likewise. + * gdb.linespec/cpls-abi-tag.exp: Likewise. + * gdb.linespec/cpls-ops.exp: Likewise. + 2018-09-19 Richard Bunt Chris January diff --git a/gdb/testsuite/gdb.base/complete-empty.exp b/gdb/testsuite/gdb.base/complete-empty.exp index 6a78538..57e5aae 100644 --- a/gdb/testsuite/gdb.base/complete-empty.exp +++ b/gdb/testsuite/gdb.base/complete-empty.exp @@ -20,6 +20,14 @@ load_lib completion-support.exp gdb_exit gdb_start +# Tests below are about tab-completion, which doesn't work if readline +# library isn't used. Check it first. + +if { ![readline_is_used] } { + untested "no tab completion support without readline" + return -1 +} + # Start of tests. # Test TAB with no input. diff --git a/gdb/testsuite/gdb.base/utf8-identifiers.exp b/gdb/testsuite/gdb.base/utf8-identifiers.exp index 12fe376..a1cc182 100644 --- a/gdb/testsuite/gdb.base/utf8-identifiers.exp +++ b/gdb/testsuite/gdb.base/utf8-identifiers.exp @@ -56,6 +56,14 @@ gdb_test "continue" \ # names getting in the way of completion. gdb_test_no_output "nosharedlibrary" +# Tests below are about tab-completion, which doesn't work if readline +# library isn't used. Check it first. + +if { ![readline_is_used] } { + untested "no tab completion support without readline" + return -1 +} + # Test linespec completion. # A unique completion. diff --git a/gdb/testsuite/gdb.cp/cpcompletion.exp b/gdb/testsuite/gdb.cp/cpcompletion.exp index 9ec3bbf..73aa3fd 100644 --- a/gdb/testsuite/gdb.cp/cpcompletion.exp +++ b/gdb/testsuite/gdb.cp/cpcompletion.exp @@ -59,6 +59,14 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { return -1 } +# Tests below are about tab-completion, which doesn't work if readline +# library isn't used. Check it first. + +if { ![readline_is_used] } { + untested "no tab completion support without readline" + return -1 +} + # Test that completion is restricted by class name (all methods) test_class_complete Foo "" "complete class methods" \ [list Foo Foofoo get_foo set_foo ~Foo] diff --git a/gdb/testsuite/gdb.linespec/cpcompletion.exp b/gdb/testsuite/gdb.linespec/cpcompletion.exp index d8aa5b2..48e1e0b 100644 --- a/gdb/testsuite/gdb.linespec/cpcompletion.exp +++ b/gdb/testsuite/gdb.linespec/cpcompletion.exp @@ -24,6 +24,14 @@ if {[prepare_for_testing "failed to prepare" $testfile \ return -1 } +# Tests below are about tab-completion, which doesn't work if readline +# library isn't used. Check it first. + +if { ![readline_is_used] } { + untested "no tab completion support without readline" + return -1 +} + # Disable the completion limit for the whole testcase. gdb_test_no_output "set max-completions unlimited" diff --git a/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp b/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp index e188637..b69f85f 100644 --- a/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp +++ b/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp @@ -26,6 +26,14 @@ if {[prepare_for_testing "failed to prepare" $testfile \ return -1 } +# Tests below are about tab-completion, which doesn't work if readline +# library isn't used. Check it first. + +if { ![readline_is_used] } { + untested "no tab completion support without readline" + return -1 +} + gdb_test_no_output "set max-completions unlimited" # Check that the explicit location completer manages to find the next diff --git a/gdb/testsuite/gdb.linespec/cpls-ops.exp b/gdb/testsuite/gdb.linespec/cpls-ops.exp index 355735e..cc66c85 100644 --- a/gdb/testsuite/gdb.linespec/cpls-ops.exp +++ b/gdb/testsuite/gdb.linespec/cpls-ops.exp @@ -24,6 +24,14 @@ if {[prepare_for_testing "failed to prepare" $testfile \ return -1 } +# Tests below are about tab-completion, which doesn't work if readline +# library isn't used. Check it first. + +if { ![readline_is_used] } { + untested "no tab completion support without readline" + return -1 +} + gdb_test_no_output "set max-completions unlimited" # Check that the explicit location completer manages to find the next