All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>, qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, stefanha@redhat.com, peter.maydell@linaro.org
Subject: Re: [Qemu-devel] [PATCH for-2.3 2/2] i440fx-test: Fix test paths to include architecture
Date: Tue, 24 Mar 2015 19:09:37 -0400	[thread overview]
Message-ID: <5511EEB1.7010306@redhat.com> (raw)
In-Reply-To: <1427237148-8728-3-git-send-email-afaerber@suse.de>



On 03/24/2015 06:45 PM, Andreas Färber wrote:
> Replace g_test_add_func() with new qtest_add_func() and modify the path
> passed to g_test_add() macro.
>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>   tests/i440fx-test.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/tests/i440fx-test.c b/tests/i440fx-test.c
> index a3f7279..bc3f54c 100644
> --- a/tests/i440fx-test.c
> +++ b/tests/i440fx-test.c
> @@ -383,8 +383,10 @@ static void add_firmware_test(const char *testpath,
>                                 void (*setup_fixture)(FirmwareTestFixture *f,
>                                                       gconstpointer test_data))
>   {
> -    g_test_add(testpath, FirmwareTestFixture, NULL, setup_fixture,
> +    char *path = g_strdup_printf("/%s%s", qtest_get_arch(), testpath);
> +    g_test_add(path, FirmwareTestFixture, NULL, setup_fixture,
>                  test_i440fx_firmware, NULL);
> +    g_free(path);
>   }
>

Is it not worth adding an even more generic wrapper to prevent future 
desynch from our preferred path format?

>   static void request_bios(FirmwareTestFixture *fixture,
> @@ -408,8 +410,8 @@ int main(int argc, char **argv)
>
>       data.num_cpus = 1;
>
> -    g_test_add_data_func("/i440fx/defaults", &data, test_i440fx_defaults);
> -    g_test_add_data_func("/i440fx/pam", &data, test_i440fx_pam);
> +    qtest_add_data_func("i440fx/defaults", &data, test_i440fx_defaults);
> +    qtest_add_data_func("i440fx/pam", &data, test_i440fx_pam);
>       add_firmware_test("/i440fx/firmware/bios", request_bios);
>       add_firmware_test("/i440fx/firmware/pflash", request_pflash);
>
>

Similar to above, is it worth replacing other test's usage of 
g_test_add_data_func to force this standard path format everywhere?

--js

  reply	other threads:[~2015-03-24 23:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24 22:45 [Qemu-devel] [PATCH for-2.3 0/2] qtest: Fix remaining test paths to include architecture Andreas Färber
2015-03-24 22:45 ` [Qemu-devel] [PATCH for-2.3 1/2] qtest: Add qtest_add_data_func() wrapper function Andreas Färber
2015-03-24 23:04   ` John Snow
2015-03-24 22:45 ` [Qemu-devel] [PATCH for-2.3 2/2] i440fx-test: Fix test paths to include architecture Andreas Färber
2015-03-24 23:09   ` John Snow [this message]
2015-03-24 23:20     ` Andreas Färber
2015-03-24 23:28       ` John Snow
2015-03-25 13:04       ` Paolo Bonzini
2015-03-25 15:29 ` [Qemu-devel] [PATCH for-2.3 0/2] qtest: Fix remaining " Stefan Hajnoczi

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=5511EEB1.7010306@redhat.com \
    --to=jsnow@redhat.com \
    --cc=afaerber@suse.de \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.