From: Simon Marchi <simon.marchi@polymtl.ca>
To: Pedro Alves <palves@redhat.com>
Cc: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Add selftests run filtering
Date: Wed, 06 Sep 2017 18:38:00 -0000 [thread overview]
Message-ID: <148b3fcdbb9bfbbb51589f585d1f3f5b@polymtl.ca> (raw)
In-Reply-To: <0cc25dd0-4311-28e8-f0ca-443719354bed@redhat.com>
On 2017-09-06 17:25, Pedro Alves wrote:
> Sounds useful.
>
> Patch looks fine to me. Nits and comments below.
>
> I wonder whether we'll want to be able to do select tests
> with e.g., a regexp instead of exact matching. If we do, then
> the std::vector->std::map change would seem pointless.
Not sure I understand. I am not using exact matching now either, so
using a map is probably already pointless. I am not sure what lead me
there, maybe I started with the intent of using exact matching. I'll
change it to a vector of a new struct type.
> Do you plan on adding some command to list the existing tests?
Yeah, why not. "maintenance info selftests"?
> On 09/05/2017 12:50 PM, Simon Marchi wrote:
>> static void
>> maintenance_selftest (char *args, int from_tty)
>> {
>> - selftests::run_tests ();
>> + selftests::selftests_results results_noarch = selftests::run_tests
>> (args);
>> + selftests::selftests_results results_arch =
>> selftests::run_tests_with_arch (args);
>
> Line too long? You could also shorten "selftests_results"
> to e.g., "test_results", since the type is already in the
> "selftests" namespace.
Done.
>> + printf_filtered (_("Ran %d unit tests, %d failed\n"),
>> + results_noarch.ran + results_arch.ran,
>> + results_noarch.failed + results_arch.failed);
>
> Wonder whether it'd make sense to implement operator+= for
> selftests_results so that you'd write:
>
> selftests::selftests_results results = selftests::run_tests (args);
> results += selftests::run_tests_with_arch (args);
> // etc.
>
> printf_filtered (_("Ran %d unit tests, %d failed\n"),
> results.ran, results.failed);
I thought it was a bit overkill for our needs, but on the other side
there's no good argument against it and it's cleaner. I'll do that.
>> _initialize_findvar (void)
>> {
>> #if GDB_SELF_TEST
>> - selftests::register_test
>> (selftests::findvar_tests::copy_integer_to_size_test);
>> + selftests::register_test (
>> + "copy_integer_to_size",
>> + selftests::findvar_tests::copy_integer_to_size_test);
>> #endif
>
> In GNU style it's much more common to break the line
> before "(", not after.
Ah ok thanks, I always have a doubt in that situation.
Simon
next prev parent reply other threads:[~2017-09-06 18:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-05 11:51 Simon Marchi
2017-09-06 15:25 ` Pedro Alves
2017-09-06 18:38 ` Simon Marchi [this message]
2017-09-06 18:41 ` Simon Marchi
2017-09-06 18:44 ` Simon Marchi
2017-09-06 18:49 ` Pedro Alves
2017-09-06 21:21 ` [PATCH v2] " Simon Marchi
2017-09-07 15:09 ` Simon Marchi
2017-09-07 15:11 ` [PATCH v3] " Simon Marchi
2017-09-16 12:08 ` Simon Marchi
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=148b3fcdbb9bfbbb51589f585d1f3f5b@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
--cc=simon.marchi@ericsson.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