Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 4/6] Fix unstable test names in gdb.python/py-objfile.exp
Date: Mon, 23 Oct 2017 14:18:00 -0000	[thread overview]
Message-ID: <1508768307-11531-5-git-send-email-palves@redhat.com> (raw)
In-Reply-To: <1508768307-11531-1-git-send-email-palves@redhat.com>

Currently, if you diff testsuite/gdb.sum of different builds you see
this spurious hunk:

  -PASS: gdb.python/py-objfile.exp: get python valueof "sep_objfile.build_id" (6a0bfcab663f9810ccff33c756afdebb940037d4)
  +PASS: gdb.python/py-objfile.exp: get python valueof "sep_objfile.build_id" (1f5531c657c57777b05fc95baa0025fd1d115c3b)

Fix this by syncing get_python_valueof with get_integer_valueof, which
stopped outputting the value in commit 2f20e312aad6
("get_integer_valueof: Don't output value in test name").

After this commit we'll show:

  PASS: gdb.python/py-objfile.exp: get python valueof "sep_objfile.build_id"

As the comment explicitly says get_python_valueof is modeled on
get_integer_valueof, I went ahead and also added the optional 'test'
parameter while at it.

gdb/testsuite/ChangeLog:
yyyy-mm-dd  Pedro Alves  <palves@redhat.com>

	* lib/gdb-python.exp (get_python_valueof): Add 'test' optional
	parameter and handle it.  Don't output read value in test name.
---
 gdb/testsuite/lib/gdb-python.exp | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/gdb/testsuite/lib/gdb-python.exp b/gdb/testsuite/lib/gdb-python.exp
index 1fef27e..c0c0d68 100644
--- a/gdb/testsuite/lib/gdb-python.exp
+++ b/gdb/testsuite/lib/gdb-python.exp
@@ -46,19 +46,23 @@ proc gdb_py_test_multiple { name args } {
     return 0
 }
 
-# Return the result of python expression EXPR.
-# DEFAULT is returned if there's an error.
-# This is modelled after get_integer_valueof.
+# Return the result of python expression EXPR.  DEFAULT is returned if
+# there's an error.  TEST is the test message to use.  It can be
+# omitted, in which case a test message is built from EXP.  This is
+# modeled after get_integer_valueof.
 
-proc get_python_valueof { exp default } {
+proc get_python_valueof { exp default {test ""} } {
     global gdb_prompt
 
-    set test "get python valueof \"${exp}\""
+    if {$test == ""} {
+	set test "get python valueof \"${exp}\""
+    }
+
     set val ${default}
     gdb_test_multiple "python print (\"valueof: %s\" % (${exp}))" "$test" {
 	-re "valueof: (\[^\r\n\]*)\[\r\n\]*$gdb_prompt $" {
 	    set val $expect_out(1,string)
-	    pass "$test ($val)"
+	    pass "$test"
 	}
 	timeout {
 	    fail "$test (timeout)"
-- 
2.5.5


  parent reply	other threads:[~2017-10-23 14:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-23 14:18 [PATCH 0/6] Fix several cases of unstable test names Pedro Alves
2017-10-23 14:18 ` [PATCH 1/6] Fix unstable test names in gdb.arch/arc-tdesc-cpu.exp Pedro Alves
2017-10-23 14:18 ` Pedro Alves [this message]
2017-10-23 14:18 ` [PATCH 5/6] Fix unstable test names in gdb.threads/attach-into-signal.exp Pedro Alves
2017-10-23 14:18 ` [PATCH 3/6] Fix unstable test names in gdb.gdb/unittest.exp Pedro Alves
2017-10-23 14:18 ` [PATCH 2/6] Fix unstable test names in gdb.base/startup-with-shell.exp Pedro Alves
2017-10-23 16:24   ` Yao Qi
2017-10-24  9:58     ` Pedro Alves
2017-10-23 14:28 ` [PATCH 6/6] Drop /proc/PID/status polling from gdb.threads/attach-into-signal.exp Pedro Alves
2017-10-24  7:27   ` Yao Qi
2017-10-24 10:00     ` [pushed] Reindent gdb.threads/attach-into-signal.exp (Re: [PATCH 6/6] Drop /proc/PID/status polling from gdb.threads/attach-into-signal.exp) Pedro Alves
2017-10-24 10:09     ` [PATCH 7/6] More gdb.threads/attach-into-signal.exp stale stopped bits " Pedro Alves

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=1508768307-11531-5-git-send-email-palves@redhat.com \
    --to=palves@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