From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [PATCH] gdb/testsuite: add details to failures in gdb_test_multiple
Date: Mon, 14 Dec 2020 23:07:29 -0500 [thread overview]
Message-ID: <20201215040729.30580-1-simon.marchi@polymtl.ca> (raw)
From: Simon Marchi <simon.marchi@efficios.com>
Some fails in gdb_test_multiple already include a description of why the
failure happened in parenthesis. Add such a description to more cases,
this will hopefully help a little bit when tracking failures (at least
it helped me).
As a reminder: the trailing parenthesis is ignored when comparing test
names, so it's a good way to provide some insight in on the failure.
gdb/testsuite/ChangeLog:
* lib/gdb.exp (gdb_test_multiple): Add descriptions to failures.
Change-Id: I6d7c9ed4450b388fbc2729f302abffba766b7ba6
---
gdb/testsuite/lib/gdb.exp | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 94bdf1ac856f..a47355b39799 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -1098,12 +1098,12 @@ proc gdb_test_multiple { command message args } {
}
-re "Undefined\[a-z\]* command:.*$prompt_regexp" {
perror "Undefined command \"$command\"."
- fail "$message"
+ fail "$message (undefined command)"
set result 1
}
-re "Ambiguous command.*$prompt_regexp" {
perror "\"$command\" is not a unique command name."
- fail "$message"
+ fail "$message (ambiguous command)"
set result 1
}
-re "$inferior_exited_re with code \[0-9\]+.*$prompt_regexp" {
@@ -1135,14 +1135,14 @@ proc gdb_test_multiple { command message args } {
}
-re "\r\n$prompt_regexp" {
if ![string match "" $message] then {
- fail "$message"
+ fail "$message (got prompt)"
}
set result 1
}
-re "$pagination_prompt" {
send_gdb "\n"
perror "Window too small."
- fail "$message"
+ fail "$message (got pagination)"
set result -1
}
-re "\\((y or n|y or \\\[n\\\]|\\\[y\\\] or n)\\) " {
@@ -1164,7 +1164,7 @@ proc gdb_test_multiple { command message args } {
set wait_status [wait -i $gdb_spawn_id]
verbose -log "GDB process exited with wait status $wait_status"
if { $message != "" } {
- fail "$message"
+ fail "$message (GDB process no longer exists)"
}
return -1
}
@@ -1184,13 +1184,13 @@ proc gdb_test_multiple { command message args } {
eof {
perror "Process no longer exists"
if { $message != "" } {
- fail "$message"
+ fail "$message (process no longer exists)"
}
return -1
}
full_buffer {
perror "internal buffer is full."
- fail "$message"
+ fail "$message (internal buffer is full)"
set result -1
}
timeout {
--
2.29.2
next reply other threads:[~2020-12-15 4:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-15 4:07 Simon Marchi via Gdb-patches [this message]
2020-12-15 5:37 ` Simon Marchi via Gdb-patches
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=20201215040729.30580-1-simon.marchi@polymtl.ca \
--to=gdb-patches@sourceware.org \
--cc=simon.marchi@efficios.com \
--cc=simon.marchi@polymtl.ca \
/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