qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Laszlo Ersek <lersek@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	David Gibson <david@gibson.dropbear.id.au>,
	Greg Kurz <groug@kaod.org>, Eric Blake <eblake@redhat.com>
Subject: [Qemu-devel] [PULL 2/7] tests/q35-test: push down qtest_start / qtest_end to test case(s)
Date: Fri, 16 Jun 2017 18:49:45 +0300	[thread overview]
Message-ID: <1497628168-30489-3-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1497628168-30489-1-git-send-email-mst@redhat.com>

From: Laszlo Ersek <lersek@redhat.com>

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" <mst@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 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

  parent reply	other threads:[~2017-06-16 15:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-16 15:49 [Qemu-devel] [PULL 0/7] pc: fixes, cleanups, features Michael S. Tsirkin
2017-06-16 15:49 ` [Qemu-devel] [PULL 1/7] q35/mch: implement extended TSEG sizes Michael S. Tsirkin
2017-06-16 15:49 ` Michael S. Tsirkin [this message]
2017-06-16 15:49 ` [Qemu-devel] [PULL 3/7] tests/q35-test: add TSEG size checks Michael S. Tsirkin
2017-06-16 15:49 ` [Qemu-devel] [PULL 4/7] intel_iommu: switching the rest DPRINTF to trace Michael S. Tsirkin
2017-06-16 15:49 ` [Qemu-devel] [PULL 5/7] intel_iommu: cleanup vtd_{do_}iommu_translate() Michael S. Tsirkin
2017-06-16 15:50 ` [Qemu-devel] [PULL 6/7] intel_iommu: cleanup vtd_interrupt_remap_msi() Michael S. Tsirkin
2017-06-16 15:50 ` [Qemu-devel] [PULL 7/7] hw/i386: fix nvdimm check error path Michael S. Tsirkin
2017-06-22  9:24 ` [Qemu-devel] [PULL 0/7] pc: fixes, cleanups, features Peter Maydell

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=1497628168-30489-3-git-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=eblake@redhat.com \
    --cc=groug@kaod.org \
    --cc=kraxel@redhat.com \
    --cc=lersek@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).