From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Marek Polacek <mpolacek@redhat.com>
Subject: Re: [RFC] Fixing gdb.base/completion.exp (PR testsuite/12649)
Date: Mon, 02 May 2011 14:58:00 -0000 [thread overview]
Message-ID: <201105021558.30272.pedro@codesourcery.com> (raw)
In-Reply-To: <4DBAC6BB.4030402@redhat.com>
On Friday 29 April 2011 15:10:03, Marek Polacek wrote:
> On 04/28/2011 05:14 PM, Pedro Alves wrote:
> > Are you sure? I did't see that when I try it.
>
> For instance this is OK:
> gdb_test_no_output "complete hfgfh" "complete 'hfgfh'"
>
> but this is not:
> gdb_test_no_output "hfgfh\t" "complete 'hfgfh'"
Haven't really looked at exactly why that happens (it's
most likely something withing gdb_test_multiple that causes
it), we can always keep the send_gdb, and pass an empty
command to gdb_test_multiple, like in the patchlet below.
>
> > And I'd much rather we do this (remote the races) as first step instead
> > of completely rewriting the whole test file into something completely
> > different...
>
> Good point.
>
> > A follow up step would convert/simplify the send_gdb+gdb_expects
> > into gdb_test&friends.
>
> Something like this attempt?
> http://sourceware.org/ml/gdb-patches/2011-04/msg00538.html
No, I mean something along the lines of the incomplete patch
below, really convert/simplifying the send_gdb+gdb_expects
into gdb_test&friends.
After that is done, the testfile should quite a bit smaller, and couple
of patterns should emerge. Then, looking at the patterns, we could
consider coming up with some helper functions that would allow
running the tests in several different ways, e.g, once with \t, and
another with "complete", as I suggested a couple of messages ago.
Made possible since we now understand what races were there in
the "\t" original version.
---
gdb/testsuite/gdb.base/completion.exp | 25 +++++++++++--------------
gdb/testsuite/lib/gdb.exp | 2 +-
2 files changed, 12 insertions(+), 15 deletions(-)
Index: src/gdb/testsuite/gdb.base/completion.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/completion.exp 2011-05-02 15:30:52.000000000 +0100
+++ src/gdb/testsuite/gdb.base/completion.exp 2011-05-02 15:50:30.649463000 +0100
@@ -94,21 +94,18 @@ if ![runto_main] then {
set oldtimeout1 $timeout
set timeout 30
-
+set test "complete 'hfgfh'"
send_gdb "hfgfh\t"
-gdb_expect {
- -re "^hfgfh\\\x07$"\
- { send_gdb "\n"
- gdb_expect {
- -re "Undefined command: \"hfgfh\"\\. Try \"help\"\\..*$gdb_prompt $"\
- { pass "complete 'hfgfh'"}
- -re ".*$gdb_prompt $" { fail "complete 'hfgfh'"}
- timeout {fail "(timeout) complete 'hfgfh'"}
- }
- }
- -re ".*$gdb_prompt $" { fail "complete 'hfgfh'" }
- timeout { fail "(timeout) complete 'hfgfh'" }
- }
+gdb_test_multiple "" "$test" {
+ -re "^hfgfh\\\x07$" {
+ send_gdb "\n"
+ gdb_test_multiple "" $test {
+ -re "Undefined command: \"hfgfh\"\\. Try \"help\"\\..*$gdb_prompt $" {
+ pass $test
+ }
+ }
+ }
+}
#exp_internal 0
Index: src/gdb/testsuite/lib/gdb.exp
===================================================================
--- src.orig/gdb/testsuite/lib/gdb.exp 2011-04-28 17:17:41.000000000 +0100
+++ src/gdb/testsuite/lib/gdb.exp 2011-05-02 15:52:55.889463000 +0100
@@ -593,7 +593,7 @@ proc gdb_test_multiple { command message
set message $command
}
- if [string match "*\[\r\n\]" $command] {
+ if { $command != "" && [string match "*\[\r\n\]" $command] } {
error "Invalid trailing newline in \"$message\" test"
}
--
Pedro Alves
next prev parent reply other threads:[~2011-05-02 14:58 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-27 14:59 Marek Polacek
2011-04-27 15:05 ` Joel Brobecker
2011-04-27 15:13 ` Tom Tromey
2011-04-27 15:23 ` Pedro Alves
2011-04-27 17:41 ` Marek Polacek
2011-04-28 14:19 ` Pedro Alves
2011-04-28 15:14 ` Pedro Alves
2011-04-29 14:10 ` Marek Polacek
2011-05-02 14:58 ` Pedro Alves [this message]
2011-05-01 9:17 ` Jan Kratochvil
2011-05-02 14:00 ` Marek Polacek
2011-05-02 14:19 ` Pedro Alves
2011-05-02 14:53 ` Jan Kratochvil
2011-05-02 15:30 ` Pedro Alves
2011-05-02 15:44 ` Joel Brobecker
2011-05-02 15:50 ` Pedro Alves
2011-05-02 15:56 ` Jan Kratochvil
2011-05-02 16:10 ` Pedro Alves
2011-05-02 16:35 ` Jan Kratochvil
2011-05-02 16:54 ` Pedro Alves
2011-05-02 17:04 ` Jan Kratochvil
2011-05-02 17:21 ` Jan Kratochvil
2011-05-02 17:23 ` Pedro Alves
2011-05-02 17:29 ` Jan Kratochvil
2011-05-02 17:53 ` Pedro Alves
2011-05-02 17:56 ` Pedro Alves
2011-05-05 15:11 ` Tom Tromey
2011-04-28 11:56 ` Marek Polacek
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=201105021558.30272.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=mpolacek@redhat.com \
/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