From 9ca9c893b617c0c182f16331021c5ff8c64c5c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 20 Apr 2022 17:26:06 +0400 Subject: include: add qemu/keyval.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do not require the whole option machinery to handle keyval, as it is used by QAPI alone, without the option API. And match the associated unit name. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Message-Id: <20220420132624.2439741-24-marcandre.lureau@redhat.com> --- tests/unit/check-qom-proplist.c | 1 + tests/unit/test-forward-visitor.c | 2 +- tests/unit/test-keyval.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/unit') diff --git a/tests/unit/check-qom-proplist.c b/tests/unit/check-qom-proplist.c index ed34108..79d4a8b 100644 --- a/tests/unit/check-qom-proplist.c +++ b/tests/unit/check-qom-proplist.c @@ -27,6 +27,7 @@ #include "qom/object.h" #include "qemu/module.h" #include "qemu/option.h" +#include "qemu/keyval.h" #include "qemu/config-file.h" #include "qom/object_interfaces.h" diff --git a/tests/unit/test-forward-visitor.c b/tests/unit/test-forward-visitor.c index 01de155..eea8ffc 100644 --- a/tests/unit/test-forward-visitor.c +++ b/tests/unit/test-forward-visitor.c @@ -15,7 +15,7 @@ #include "qapi/qmp/qobject.h" #include "qapi/qmp/qdict.h" #include "test-qapi-visit.h" -#include "qemu/option.h" +#include "qemu/keyval.h" typedef bool GenericVisitor (Visitor *, const char *, void **, Error **); #define CAST_VISIT_TYPE(fn) ((GenericVisitor *)(fn)) diff --git a/tests/unit/test-keyval.c b/tests/unit/test-keyval.c index af0581a..4dc52c7 100644 --- a/tests/unit/test-keyval.c +++ b/tests/unit/test-keyval.c @@ -19,7 +19,7 @@ #include "qapi/qobject-input-visitor.h" #include "test-qapi-visit.h" #include "qemu/cutils.h" -#include "qemu/option.h" +#include "qemu/keyval.h" static void test_keyval_parse(void) { -- cgit v1.1 From 215aea0cb2c1ede4bac8877a8c85b66568bed694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 20 Apr 2022 17:26:07 +0400 Subject: include: move qdict_{crumple,flatten} declarations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move them where they belong, since the functions are implemented in block-qdict.c. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Message-Id: <20220420132624.2439741-25-marcandre.lureau@redhat.com> --- tests/unit/check-qobject.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/unit') diff --git a/tests/unit/check-qobject.c b/tests/unit/check-qobject.c index 0ed094e..c5e850a 100644 --- a/tests/unit/check-qobject.c +++ b/tests/unit/check-qobject.c @@ -15,6 +15,7 @@ #include "qapi/qmp/qnull.h" #include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" +#include "block/qdict.h" #include -- cgit v1.1 From 5472b5b6a42482e924014bca0c42a79044d6e7d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 20 Apr 2022 17:26:08 +0400 Subject: tests: remove block/qdict checks from check-qobject.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The functions are already covered in check-block-qdict.c. This will help moving QAPI-related tests in a common subproject. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Message-Id: <20220420132624.2439741-26-marcandre.lureau@redhat.com> --- tests/unit/check-qobject.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'tests/unit') diff --git a/tests/unit/check-qobject.c b/tests/unit/check-qobject.c index c5e850a..022b7c7 100644 --- a/tests/unit/check-qobject.c +++ b/tests/unit/check-qobject.c @@ -15,7 +15,6 @@ #include "qapi/qmp/qnull.h" #include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" -#include "block/qdict.h" #include @@ -179,7 +178,6 @@ static void qobject_is_equal_list_test(void) static void qobject_is_equal_dict_test(void) { g_autoptr(QDict) dict_cloned = NULL; - g_autoptr(QDict) dict_crumpled = NULL; g_autoptr(QDict) dict_0 = qdict_new(); g_autoptr(QDict) dict_1 = qdict_new(); g_autoptr(QDict) dict_different_key = qdict_new(); @@ -237,12 +235,6 @@ static void qobject_is_equal_dict_test(void) dict_different_null_key, dict_longer, dict_shorter, dict_nested); - dict_crumpled = qobject_to(QDict, qdict_crumple(dict_1, &error_abort)); - check_equal(dict_crumpled, dict_nested); - - qdict_flatten(dict_nested); - check_equal(dict_0, dict_nested); - /* Containing an NaN value will make this dict compare unequal to * itself */ qdict_put(dict_0, "NaN", qnum_from_double(NAN)); -- cgit v1.1 From a7bd942c900ff83b25ccef68629b34831db03a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 20 Apr 2022 17:26:12 +0400 Subject: tests: run-time skip test-qga if TSAN is enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows to make sure the test is still built, and gives more accurate report details. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Message-Id: <20220420132624.2439741-30-marcandre.lureau@redhat.com> --- tests/unit/meson.build | 2 +- tests/unit/test-qga.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'tests/unit') diff --git a/tests/unit/meson.build b/tests/unit/meson.build index 026e39f..ab01e00 100644 --- a/tests/unit/meson.build +++ b/tests/unit/meson.build @@ -153,7 +153,7 @@ if have_system endif endif -if have_ga and targetos == 'linux' and 'CONFIG_TSAN' not in config_host +if have_ga and targetos == 'linux' tests += {'test-qga': ['../qtest/libqtest.c']} test_deps += {'test-qga': qga} endif diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c index 5cb140d..e17a288 100644 --- a/tests/unit/test-qga.c +++ b/tests/unit/test-qga.c @@ -969,6 +969,13 @@ int main(int argc, char **argv) TestFixture fix; int ret; +#ifdef QEMU_SANITIZE_THREAD + { + g_test_skip("tsan enabled, https://github.com/google/sanitizers/issues/1116"); + return 0; + } +#endif + setlocale (LC_ALL, ""); g_test_init(&argc, &argv, NULL); fixture_setup(&fix, NULL, NULL); -- cgit v1.1