From: Keith Seitz <keiths@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH] Use gdb_test_no_output for compile tests expected to pass
Date: Thu, 16 Aug 2018 21:49:00 -0000 [thread overview]
Message-ID: <20180816214827.21559-1-keiths@redhat.com> (raw)
There is a small think-o in compile.exp:
if { $srcfile3 != "" } {
gdb_test "p constvar" " = 3"
gdb_test "info addr constvar" {Symbol "constvar" is constant\.}
gdb_test "compile code globalvar = constvar;"; # INCORRECT
gdb_test "print globalvar" " = 3" "print constvar value"
} else {
untested "print constvar value"
}
The line marked INCORRECT runs a simple "compile code" which is expected
to succeed. When this happens, the compile plug-in and GDB will not
output anything. The use of gdb_test matches against anything.
This is certainly not the intent, and this patch corrects the two instances
of this in the file. [The rest of gdb.compile looks okay.]
testsuite/ChangeLog:
* gdb.compile/compile.exp: Use gdb_test_no_output for "compile code"
tests expected to pass.
---
gdb/testsuite/ChangeLog | 5 +++++
gdb/testsuite/gdb.compile/compile.exp | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 1b4dde59bb..292e0ca1ae 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+YYYY-MM-DD Keith Seitz <keiths@redhat.com>
+
+ * gdb.compile/compile.exp: Use gdb_test_no_output for "compile code"
+ tests expected to pass.
+
2018-08-14 Jan Vrany <jan.vrany@fit.cvut.cz>
* gdb.mi/mi-disassemble.exp (test_disassembly_only): Add tests for
diff --git a/gdb/testsuite/gdb.compile/compile.exp b/gdb/testsuite/gdb.compile/compile.exp
index 4303c02f26..2ed5577752 100644
--- a/gdb/testsuite/gdb.compile/compile.exp
+++ b/gdb/testsuite/gdb.compile/compile.exp
@@ -256,7 +256,7 @@ gdb_test "print union_object.intfield" " = 7"
# LOC_UNRESOLVED tests.
gdb_test "print unresolved" " = 20"
-gdb_test "compile code globalvar = unresolved;"
+gdb_test_no_output "compile code globalvar = unresolved;"
gdb_test "print globalvar" " = 20" "print unresolved value"
# Test shadowing with global and static variables.
@@ -353,7 +353,7 @@ if { $srcfile3 != "" } {
gdb_test "p constvar" " = 3"
gdb_test "info addr constvar" {Symbol "constvar" is constant\.}
- gdb_test "compile code globalvar = constvar;"
+ gdb_test_no_output "compile code globalvar = constvar;"
gdb_test "print globalvar" " = 3" "print constvar value"
} else {
untested "print constvar value"
--
2.13.6
next reply other threads:[~2018-08-16 21:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-16 21:49 Keith Seitz [this message]
2018-08-16 23:39 ` Tom Tromey
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=20180816214827.21559-1-keiths@redhat.com \
--to=keiths@redhat.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