From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLtVU-0002ql-91 for qemu-devel@nongnu.org; Fri, 16 Jun 2017 11:49:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLtVR-0002rS-5b for qemu-devel@nongnu.org; Fri, 16 Jun 2017 11:49:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39686) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dLtVQ-0002r7-V7 for qemu-devel@nongnu.org; Fri, 16 Jun 2017 11:49:53 -0400 Date: Fri, 16 Jun 2017 18:49:45 +0300 From: "Michael S. Tsirkin" Message-ID: <1497628168-30489-3-git-send-email-mst@redhat.com> References: <1497628168-30489-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1497628168-30489-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 2/7] tests/q35-test: push down qtest_start / qtest_end to test case(s) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Laszlo Ersek , Gerd Hoffmann , Paolo Bonzini , David Gibson , Greg Kurz , Eric Blake From: Laszlo Ersek A test program can start up QEMU several times, with different command lines. For such cases, qtest_start() and qtest_end() are called from within the individual test functions. Examples: "virtio-console-test.c", "numa-test.c", and many others. Cc: "Michael S. Tsirkin" Cc: Gerd Hoffmann Cc: Paolo Bonzini Signed-off-by: Laszlo Ersek Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/q35-test.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/q35-test.c b/tests/q35-test.c index cc58f3e..6c21b40 100644 --- a/tests/q35-test.c +++ b/tests/q35-test.c @@ -42,6 +42,8 @@ static void test_smram_lock(void) QPCIDevice *pcidev; QDict *response; + qtest_start("-M q35"); + pcibus = qpci_init_pc(NULL); g_assert(pcibus != NULL); @@ -74,19 +76,15 @@ static void test_smram_lock(void) g_free(pcidev); qpci_free_pc(pcibus); + + qtest_end(); } int main(int argc, char **argv) { - int ret; - g_test_init(&argc, &argv, NULL); qtest_add_func("/q35/smram/lock", test_smram_lock); - qtest_start("-M q35"); - ret = g_test_run(); - qtest_end(); - - return ret; + return g_test_run(); } -- MST