From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YatYq-0002ix-6p for qemu-devel@nongnu.org; Wed, 25 Mar 2015 18:14:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YatYm-0001lq-OW for qemu-devel@nongnu.org; Wed, 25 Mar 2015 18:14:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YatYm-0001li-Gg for qemu-devel@nongnu.org; Wed, 25 Mar 2015 18:14:00 -0400 Message-ID: <55133325.9070207@redhat.com> Date: Wed, 25 Mar 2015 18:13:57 -0400 From: John Snow MIME-Version: 1.0 References: <1427307623-2425-1-git-send-email-afaerber@suse.de> <1427307623-2425-3-git-send-email-afaerber@suse.de> In-Reply-To: <1427307623-2425-3-git-send-email-afaerber@suse.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-2.3 v2 2/4] qtest: Add qtest_add() wrapper macro List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , qemu-devel@nongnu.org Cc: pbonzini@redhat.com, Anthony Liguori , stefanha@redhat.com On 03/25/2015 02:20 PM, Andreas F=C3=A4rber wrote: > It extends g_test_add() macro with the architecture path. > > Signed-off-by: Andreas F=C3=A4rber > --- > tests/libqtest.h | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/tests/libqtest.h b/tests/libqtest.h > index 9281f5c..03469b8 100644 > --- a/tests/libqtest.h > +++ b/tests/libqtest.h > @@ -357,6 +357,26 @@ void qtest_add_func(const char *str, void (*fn)); > void qtest_add_data_func(const char *str, const void *data, void (*fn= )); > > /** > + * qtest_add: > + * @testpath: Test case path > + * @Fixture: Fixture type > + * @tdata: Test case data > + * @fsetup: Test case setup function > + * @ftest: Test case function > + * @fteardown: Test case teardown function > + * > + * Add a GTester testcase with the given name, data and functions. > + * The path is prefixed with the architecture under test, as > + * returned by qtest_get_arch(). > + */ > +#define qtest_add(testpath, Fixture, tdata, fsetup, ftest, fteardown) = \ > + do { \ > + char *path =3D g_strdup_printf("/%s/%s", qtest_get_arch(), tes= tpath); \ > + g_test_add(path, Fixture, tdata, fsetup, ftest, fteardown); \ > + g_free(path); \ > + } while (0) > + > +/** > * qtest_start: > * @args: other arguments to pass to QEMU > * > Reviewed-by: John Snow