From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yakyq-00013E-RZ for qemu-devel@nongnu.org; Wed, 25 Mar 2015 09:04:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yakyo-0005cz-5i for qemu-devel@nongnu.org; Wed, 25 Mar 2015 09:04:20 -0400 Received: from mail-wi0-x230.google.com ([2a00:1450:400c:c05::230]:34661) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yakyn-0005cr-UT for qemu-devel@nongnu.org; Wed, 25 Mar 2015 09:04:18 -0400 Received: by wibg7 with SMTP id g7so73942123wib.1 for ; Wed, 25 Mar 2015 06:04:17 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <5512B24B.1080608@redhat.com> Date: Wed, 25 Mar 2015 14:04:11 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1427237148-8728-1-git-send-email-afaerber@suse.de> <1427237148-8728-3-git-send-email-afaerber@suse.de> <5511EEB1.7010306@redhat.com> <5511F159.2030506@suse.de> In-Reply-To: <5511F159.2030506@suse.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH for-2.3 2/2] i440fx-test: Fix test paths to include architecture List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , John Snow , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, stefanha@redhat.com On 25/03/2015 00:20, Andreas Färber wrote: >>> >> - 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? > As mentioned in the commit message, g_test_add() is a macro, not a > function, so seemed more complicated to wrap. Can you post a patch if > you have an idea? :) > You would have to wrap g_test_add_vtable with qtest_add_vtable, and then add a macro that mimicks g_test_add: /* hook up a test with fixture under test path */ #define qtest_add(testpath, Fixture, tdata, fsetup, ftest, fteardown) \ G_STMT_START { \ void (*add_vtable) (const char*, \ gsize, \ gconstpointer, \ void (*) (Fixture*, gconstpointer), \ void (*) (Fixture*, gconstpointer), \ void (*) (Fixture*, gconstpointer)) = (void (*) (const gchar *, gsize, gconstpointer, void ( *) (Fixture*, gconstpointer), void (*) (Fixture*, gconstpointer), void (*) (Fixture*, gconstpointer))) qtest_add_vtable; \ add_vtable \ (testpath, sizeof (Fixture), tdata, fsetup, ftest, fteardown); \ } G_STMT_END Paolo