Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2 1/5] gdb/testsuite: Introduce "proc_with_prefix"
Date: Wed, 09 Nov 2016 01:56:00 -0000	[thread overview]
Message-ID: <79350921c479daa902253c180b12842a@polymtl.ca> (raw)
In-Reply-To: <1478650771-24430-2-git-send-email-palves@redhat.com>

On 2016-11-08 19:19, Pedro Alves wrote:
> While adding new tests to gdb.base/commands.exp, I noticed that the
> file includes a bunch of individual testcases split into their own
> procedures, and that none have ever been adjusted to use
> with_test_prefix.  Instead, each gdb_test/gdb_test_multiple/etc
> invocation takes care of including the procedure name in the test
> message, in order to make sure test messages are unique.
> 
> Simon convinced me that using the procedure name as prefix is not that
> bad of an idea:
>   https://sourceware.org/ml/gdb-patches/2016-10/msg00020.html
> 
> This commit adds an IMO simpler alternative to
> with_test_prefix_procname added by that patch -- a new
> "proc_with_prefix" convenience proc that is meant to be used in place
> of "proc", and then uses it in commands.exp.  Procedures defined with
> this automatically run their bodies under with_test_prefix $proc_name.
> 
> Here's a sample of the resulting gdb.sum diff:
> 
>  [...]
>  -PASS: gdb.base/commands.exp: break factorial #3
>  -PASS: gdb.base/commands.exp: set value to 5 in 
> test_command_prompt_position
>  -PASS: gdb.base/commands.exp: if test in test_command_prompt_position
>  -PASS: gdb.base/commands.exp: > OK in test_command_prompt_position
>  +PASS: gdb.base/commands.exp: test_command_prompt_position: break 
> factorial
>  +PASS: gdb.base/commands.exp: test_command_prompt_position: set value 
> to 5
>  +PASS: gdb.base/commands.exp: test_command_prompt_position: if test
>  +PASS: gdb.base/commands.exp: test_command_prompt_position: > OK
>  [...]

LGTM.  I think it's acceptable to use the proc name as a prefix in this 
case.  If you take care of choosing a good proc name, what you would 
pass manually to with_test_prefix otherwise would be basically the proc 
name without underscores ("test_command_prompt_position" vs "test 
command prompt position").  It can save some typing and indentation.

I'll send a patch that makes gdb.mi/user-selected-context-sync.exp use 
this new feature.

Thanks!

Simon


  reply	other threads:[~2016-11-09  1:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-09  0:19 [PATCH v2 0/5] Support an "unlimited" number of user-defined arguments Pedro Alves
2016-11-09  0:19 ` [PATCH v2 3/5] Fix PR 20559 - "eval" command and $arg0...$arg9/$argc substitution Pedro Alves
2016-11-09  0:19 ` [PATCH v2 2/5] Further cleanup/modernization of gdb.base/commands.exp Pedro Alves
2016-11-09  3:02   ` Simon Marchi
2016-11-09 15:56     ` Pedro Alves
2016-11-09 15:59       ` Pedro Alves
2016-11-09 16:09         ` Simon Marchi
2016-11-09 16:16           ` Pedro Alves
2016-11-09 16:25             ` Simon Marchi
2016-11-09 18:51               ` Pedro Alves
2016-11-09 16:22           ` Pedro Alves
2016-11-09 16:37             ` Pedro Alves
2016-11-09 16:41               ` Pedro Alves
2016-11-09  0:19 ` [PATCH v2 1/5] gdb/testsuite: Introduce "proc_with_prefix" Pedro Alves
2016-11-09  1:56   ` Simon Marchi [this message]
2016-11-09  3:10   ` [PATCH] Make gdb.mi/user-selected-context-sync.exp use proc_with_prefix Simon Marchi
2016-11-09 15:15     ` Pedro Alves
2016-11-09 15:57       ` Simon Marchi
2016-11-09 11:50   ` [PATCH v2 1/5] gdb/testsuite: Introduce "proc_with_prefix" Yao Qi
2016-11-09  0:25 ` [PATCH v2 5/5] Support an "unlimited" number of user-defined arguments Pedro Alves
2016-11-09  0:26 ` [PATCH v2 4/5] Test user-defined gdb commands and arguments stack 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=79350921c479daa902253c180b12842a@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /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