qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-2.3 v2 2/4] qtest: Add qtest_add() wrapper m


From: John Snow
Subject: Re: [Qemu-devel] [PATCH for-2.3 v2 2/4] qtest: Add qtest_add() wrapper macro
Date: Wed, 25 Mar 2015 18:13:57 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0



On 03/25/2015 02:20 PM, Andreas Färber wrote:
It extends g_test_add() macro with the architecture path.

Signed-off-by: Andreas Färber <address@hidden>
---
  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 = g_strdup_printf("/%s/%s", qtest_get_arch(), testpath); \
+        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 <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]