public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/3] Add "complete break ada" test to gdb.ada/complete.exp
Date: Thu, 04 Jan 2018 08:36:00 -0000	[thread overview]
Message-ID: <1515054953-81012-3-git-send-email-brobecker@adacore.com> (raw)
In-Reply-To: <1515054953-81012-1-git-send-email-brobecker@adacore.com>

This patch adds a new test to demonstrate a regression introduced by:

    commit b5ec771e60c1a0863e51eb491c85c674097e9e13
    Date:   Wed Nov 8 14:22:32 2017 +0000
    Subject: Introduce lookup_name_info and generalize Ada's FULL/WILD name matching

The original purpose of the new test is to exercise the "complete"
command with an expression for which a large number of matches are
returned and to verify that each match returned is a plausible match.
In this particular case, the commit above causes GDB to generate
additional matches which should in fact not appear in the list
(internally generated symbols, or symbols that should be enclosed
between "<...>"). These extraneous entries are easy to spot, because
they have uppercase characters, such as:

    break ada__stringsS
    break ada__strings__R11s
    [etc]

For now, the new test is KFAIL'ed, to avoid generating a new FAIL
while we work on fixing that regression.

gdb/testsuite/ChangeLog:

        PR gdb/22670
        * gdb.ada/complete.exp: Add "complete break ada" test.

Tested on x86_64-linux with GDB built before and after the patch
that caused the regression (b5ec771e60c1a0863e51eb491c85c674097e9e13).
The test passes before the regression, and generates a KFAIL after.
---
 gdb/testsuite/ChangeLog            |  5 +++++
 gdb/testsuite/gdb.ada/complete.exp | 21 +++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index b1be7e3..a81f9da 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,6 +1,11 @@
 2018-01-04  Joel Brobecker  <brobecker@adacore.com>
 
 	PR gdb/22670
+	* gdb.ada/complete.exp: Add "complete break ada" test.
+
+2018-01-04  Joel Brobecker  <brobecker@adacore.com>
+
+	PR gdb/22670
 	* gdb.ada/info_addr_mixed_case: New testcase.
 
 2018-01-03  Xavier Roirand  <roirand@adacore.com>
diff --git a/gdb/testsuite/gdb.ada/complete.exp b/gdb/testsuite/gdb.ada/complete.exp
index 9b64d15..c1f22c2 100644
--- a/gdb/testsuite/gdb.ada/complete.exp
+++ b/gdb/testsuite/gdb.ada/complete.exp
@@ -204,3 +204,24 @@ test_gdb_complete "ambiguous_f" \
                   "p ambiguous_func"
 test_gdb_complete "ambiguous_func" \
                   "p ambiguous_func"
+
+# Perform a test intented to verify the behavior where the number
+# of possible completions is very large.  The goal is not to verify
+# precisely the list returned by the complete command (this depends
+# on too many parameters -- targets, compiler version, runtime, etc).
+# However, we want to sanity-check each one of them, knowing that
+# each result should start with "break ada" and that the proposed
+# completion should look like a valid symbol name (in particular,
+# no uppercase letters...).
+
+gdb_test_no_output "set max-completions unlimited"
+
+set test "complete break ada"
+gdb_test_multiple "$test" $test {
+    -re "^$test$eol\(break ada(\[a-z0-9._\])*$eol\)+$gdb_prompt $" {
+        pass $test
+    }
+    -re "\[A-Z\].*$gdb_prompt $" {
+        kfail gdb/22670 $test
+    }
+}
-- 
2.1.4

  parent reply	other threads:[~2018-01-04  8:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-04  8:36 FYI/pushed: Additional tests showing regression post C++ wild matching Joel Brobecker
2018-01-04  8:36 ` [PATCH 1/3] Add gdb.ada/info_addr_mixed_case new testcase Joel Brobecker
2018-01-04 13:25   ` Pedro Alves
2018-01-04 18:33     ` Pedro Alves
2018-01-05  3:22       ` Joel Brobecker
2018-01-05 16:06         ` Pedro Alves
2018-01-04  8:36 ` Joel Brobecker [this message]
2018-01-05 16:37   ` [PATCH] Fix gdb.ada/complete.exp's "complete break ada" test (PR, gdb/22670) (Re: [PATCH 2/3] Add "complete break ada" test to gdb.ada/complete.exp) Pedro Alves
2018-01-08  4:05     ` Joel Brobecker
2018-01-04  8:36 ` [PATCH 3/3] Add new gdb.ada/bp_c_mixed_case testcase for PR gdb/22670 Joel Brobecker
2018-01-05 16:34   ` Fix gdb.ada/bp_c_mixed_case.exp (PR gdb/22670) (Re: [PATCH 3/3] Add new gdb.ada/bp_c_mixed_case testcase for PR gdb/22670) Pedro Alves
2018-01-08  3:57     ` Joel Brobecker
2018-01-08 15:00       ` Pedro Alves
2018-01-09  9:46         ` Joel Brobecker
2018-01-09 14:59           ` Pedro Alves
2018-01-09 16:45             ` Pedro Alves
2018-01-09 17:22               ` Pedro Alves
2018-01-10  3:36               ` Joel Brobecker
2018-01-10 23:41                 ` Pedro Alves
2018-01-11  4:00                   ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1515054953-81012-3-git-send-email-brobecker@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).