From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH] Fix list.exp test cases
Date: Thu, 24 Feb 2022 08:40:29 -0700 [thread overview]
Message-ID: <20220224154029.940785-1-tromey@adacore.com> (raw)
PR testsuite/7142 -- old enough to have been converted from Gnats --
points out that test_list_filename_and_function in gdb.base/list.exp
has "fails" that are unmatched with passes. This patch cleans this up
a little.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7142
---
gdb/testsuite/gdb.base/list.exp | 28 ++++++++++++----------------
1 file changed, 12 insertions(+), 16 deletions(-)
diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp
index d035d9b1613..35206b993e1 100644
--- a/gdb/testsuite/gdb.base/list.exp
+++ b/gdb/testsuite/gdb.base/list.exp
@@ -251,18 +251,16 @@ proc test_list_filename_and_function {} {
global gdb_prompt
global last_line_re
- set testcnt 0
-
# gcc appears to generate incorrect debugging information for code
# in include files, which breaks this test.
# SunPRO cc is the second case below, it's also correct.
send_gdb "list list0.c:main\n"
gdb_expect {
-re "1\[ \t\]+#include .*10\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
- incr testcnt
+ pass "list list0.c:main"
}
-re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
- pass "list function in source file 1"
+ pass "list list0.c:main"
}
-re ".*$gdb_prompt $" { fail "list list0.c:main" }
timeout { fail "list list0.c:main (timeout)" }
@@ -274,10 +272,10 @@ proc test_list_filename_and_function {} {
send_gdb "list list0.c:unused\n"
gdb_expect {
-re "40\[ \t\]+unused.*${last_line_re}\r\n$gdb_prompt $" {
- incr testcnt
+ pass "list list0.c:unused"
}
-re "37.*42\[ \t\]+\}\r\n$gdb_prompt $" {
- incr testcnt
+ pass "list list0.c:unused"
}
-re ".*$gdb_prompt $" { fail "list list0.c:unused" }
timeout { fail "list list0.c:unused (timeout)" }
@@ -293,13 +291,13 @@ proc test_list_filename_and_function {} {
send_gdb "list list0.h:foo\n"
gdb_expect {
-re "2\[ \t\]+including file. This.*11\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
- incr testcnt
+ pass "list list0.h:foo"
}
-re "1\[ \t\]+/. An include file.*10\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
- incr testcnt
+ pass "list list0.h:foo"
}
-re "3\[ \t\]+.*12\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
- incr testcnt
+ pass "list list0.h:foo"
}
-re "No source file named list0.h.\r\n$gdb_prompt $" {
fail "list list0.h:foo"
@@ -312,13 +310,13 @@ proc test_list_filename_and_function {} {
send_gdb "list list1.c:bar\n"
gdb_expect {
-re "4\[ \t\]+void.*13\[ \t\]+\}\r\n$gdb_prompt $" {
- incr testcnt
+ pass "list list1.c:bar"
}
-re "4\[ \t\]+void.*12\[ \t\]*long_line ..;\r\n$gdb_prompt $" {
- incr testcnt
+ pass "list list1.c:bar"
}
-re "4\[ \t\]+void.*11\[ \t\]*\r\n$gdb_prompt $" {
- incr testcnt
+ pass "list list1.c:bar"
}
-re ".*$gdb_prompt $" { fail "list list1.c:bar" }
timeout { fail "list list1.c:bar (timeout)" }
@@ -330,18 +328,16 @@ proc test_list_filename_and_function {} {
send_gdb "list list1.c:unused\n"
gdb_expect {
-re "12\[ \t\]+long_line \[(\]\[)\];.*13\[ \t\]+\}\r\n.*$gdb_prompt $" {
- incr testcnt
+ pass "list list1.c:unused"
}
-re "14.*19\[ \t\]+\}\r\n.*$gdb_prompt $" {
- incr testcnt
+ pass "list list1.c:unused"
}
-re ".*$gdb_prompt $" { fail "list list1.c:unused" }
timeout { fail "list list1.c:unused (timeout)" }
}
clear_xfail "rs6000-*-aix*"
- pass "list filename:function ($testcnt tests)"
-
# Test with quoting.
gdb_test "list 'list0.c:main'" "int main.*"
--
2.31.1
next reply other threads:[~2022-02-24 15:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-24 15:40 Tom Tromey [this message]
2022-02-24 18:13 ` Andrew Burgess
2022-02-24 21:36 ` Tom Tromey
2022-02-25 11:51 ` Andrew Burgess
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=20220224154029.940785-1-tromey@adacore.com \
--to=tromey@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).