Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Sergio Durigan Junior <sergiodj@redhat.com>
To: GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Uniquify test names from gdb.python/{py-objfile.exp,py-pp-registration.exp}
Date: Tue, 28 Jul 2015 21:40:00 -0000	[thread overview]
Message-ID: <871tfsq7uc.fsf@redhat.com> (raw)
In-Reply-To: <1437772393-6739-1-git-send-email-sergiodj@redhat.com> (Sergio	Durigan Junior's message of "Fri, 24 Jul 2015 17:13:13 -0400")

On Friday, July 24 2015, I wrote:

> While running some regression tests, I noticed that the two Python
> tests mentioned in the $SUBJECT contain non-unique names.  This is a
> violation of our guidelines:
>
>   <https://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Make_sure_test_messages_are_unique>

I went ahead and pushed this:

  <https://sourceware.org/ml/gdb-cvs/2015-07/msg00195.html>

Let me know if there is any problem.

> And also makes things harder for BuildBot.  So I hacked both testcases
> and made every test name unique.  I guess this could be considered an
> obvious patch, but I decided to post it before pushing because others
> may have different opinions about the names.
>
> OK to apply?
>
> gdb/testsuite/ChangeLog:
> 2015-07-24  Sergio Durigan Junior  <sergiodj@redhat.com>
>
> 	* gdb.python/py-objfile.exp: Make some tests have unique names.
> 	* gdb.python/py-pp-registration.exp: Likewise.
> ---
>  gdb/testsuite/gdb.python/py-objfile.exp         | 15 +++++++++------
>  gdb/testsuite/gdb.python/py-pp-registration.exp | 11 ++++++++---
>  2 files changed, 17 insertions(+), 9 deletions(-)
>
> diff --git a/gdb/testsuite/gdb.python/py-objfile.exp b/gdb/testsuite/gdb.python/py-objfile.exp
> index 4de20c5..7dd094c 100644
> --- a/gdb/testsuite/gdb.python/py-objfile.exp
> +++ b/gdb/testsuite/gdb.python/py-objfile.exp
> @@ -46,7 +46,7 @@ gdb_test "python print (objfile.username)" "${testfile}" \
>    "Get objfile user name"
>  
>  gdb_test "python print (gdb.lookup_objfile (\"${testfile}\").filename)" \
> -    "${testfile}"
> +    "${testfile}" "print lookup_objfile filename"
>  gdb_test "python print (gdb.lookup_objfile (\"junk\"))" \
>      "Objfile not found\\.\r\n${python_error_text}"
>  
> @@ -56,7 +56,7 @@ if [string compare $binfile_build_id ""] {
>      gdb_test "python print (objfile.build_id)" "$binfile_build_id" \
>      "Get objfile build id"
>      gdb_test "python print (gdb.lookup_objfile (\"$binfile_build_id\", by_build_id=True).filename)" \
> -	"${testfile}"
> +	"${testfile}" "print lookup_objfile filename by build-id"
>  } else {
>      unsupported "build-id is not supported by the compiler"
>  }
> @@ -64,9 +64,11 @@ if [string compare $binfile_build_id ""] {
>  # Other lookup_objfile_by_build_id tests we can do, even if compiler doesn't
>  # support them.
>  gdb_test "python print (gdb.lookup_objfile (\"foo\", by_build_id=True))" \
> -    "Not a valid build id\\.\r\n${python_error_text}"
> +    "Not a valid build id\\.\r\n${python_error_text}" \
> +    "print invalid file lookup_objfile by build-id"
>  gdb_test "python print (gdb.lookup_objfile (\"1234abcdef\", by_build_id=True))" \
> -    "Objfile not found\\.\r\n${python_error_text}"
> +    "Objfile not found\\.\r\n${python_error_text}" \
> +    "print invalid file lookup_objfile by build-id 2"
>  
>  gdb_test "python print (objfile.progspace)" "<gdb\.Progspace object at .*>" \
>    "Get objfile program space"
> @@ -104,7 +106,7 @@ if ![runto_main] {
>      return 0
>  }
>  
> -gdb_py_test_silent_cmd "python objfile = gdb.objfiles()\[0\]" \
> +gdb_py_test_silent_cmd "python objfile = gdb.s()\[0\]" \
>      "Get no-debug objfile file" 1
>  
>  gdb_test "python print (objfile.owner)" "None" \
> @@ -131,7 +133,8 @@ gdb_test "p main" "= {int \\(\\)} $hex <main>" \
>  # Separate debug files are not findable.
>  if { [get_python_valueof "sep_objfile.build_id" "None"] != "None" } {
>      gdb_test "python print (gdb.lookup_objfile (sep_objfile.build_id, by_build_id=True))" \
> -	"Objfile not found\\.\r\n${python_error_text}"
> +	"Objfile not found\\.\r\n${python_error_text}" \
> +	"print lookup_objfile of separate debug file"
>  }
>  
>  # An objfile that was a symlink to a differently named file is still
> diff --git a/gdb/testsuite/gdb.python/py-pp-registration.exp b/gdb/testsuite/gdb.python/py-pp-registration.exp
> index 2193407..60f3436 100644
> --- a/gdb/testsuite/gdb.python/py-pp-registration.exp
> +++ b/gdb/testsuite/gdb.python/py-pp-registration.exp
> @@ -46,7 +46,8 @@ proc prepare_test { } {
>  	return 0
>      }
>  
> -    gdb_test_no_output "python exec (open ('${remote_python_file}').read ())"
> +    gdb_test_no_output "python exec (open ('${remote_python_file}').read ())" \
> +	"read file"
>  
>      gdb_test_no_output "py progspace = gdb.current_progspace()"
>      gdb_test_no_output "py my_pretty_printer1 = build_pretty_printer1()"
> @@ -108,9 +109,13 @@ with_test_prefix "replace" {
>      gdb_test "py gdb.printing.register_pretty_printer(progspace, my_pretty_printer2, replace=False)" \
>  	"RuntimeError: pretty-printer already registered: pp-test\r\nError while executing Python code."
>  
> -    test_printers "s1"
> +    with_test_prefix "test printers 1" {
> +	test_printers "s1"
> +    }
>  
>      gdb_test_no_output "py gdb.printing.register_pretty_printer(progspace, my_pretty_printer2, replace=True)"
>  
> -    test_printers "s2"
> +    with_test_prefix "test printers 2" {
> +	test_printers "s2"
> +    }
>  }
> -- 
> 2.4.3

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/


       reply	other threads:[~2015-07-28 21:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1437772393-6739-1-git-send-email-sergiodj@redhat.com>
2015-07-28 21:40 ` Sergio Durigan Junior [this message]
2015-07-28 22:25   ` Pedro Alves
2015-07-29 10:36 ` Pedro Alves
2015-07-29 14:21   ` Sergio Durigan Junior
2015-07-29 14:34     ` 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=871tfsq7uc.fsf@redhat.com \
    --to=sergiodj@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