提交 4dd60540 编写于 作者: J Ján Tomko

m4: Introduce STABLE_ORDERING_JANSSON

Add a second check for Jansson >= 2.8, which includes
fixes to preserve ordering of object keys.

Use this constant to guard tests that depend on stable ordering.
Signed-off-by: NJán Tomko <jtomko@redhat.com>
上级 01ce0437
......@@ -22,6 +22,9 @@ AC_DEFUN([LIBVIRT_ARG_JANSSON],[
AC_DEFUN([LIBVIRT_CHECK_JANSSON],[
dnl Jansson http://www.digip.org/jansson/
LIBVIRT_CHECK_PKG([JANSSON], [jansson], [2.5])
dnl Older versions of Jansson did not preserve the order of object keys
dnl use this check to guard the tests that are sensitive to this
LIBVIRT_CHECK_PKG([STABLE_ORDERING_JANSSON], [jansson], [2.8], [true])
])
AC_DEFUN([LIBVIRT_RESULT_JANSSON],[
......
......@@ -337,6 +337,11 @@ mymain(void)
char *capslatest_x86_64 = NULL;
virQEMUCapsPtr caps_x86_64 = NULL;
#if !WITH_STABLE_ORDERING_JANSSON
fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
return EXIT_AM_SKIP;
#endif
if (qemuTestDriverInit(&driver) < 0)
return EXIT_FAILURE;
......
......@@ -141,6 +141,11 @@ mymain(void)
int ret = 0;
testQemuData data;
#if !WITH_STABLE_ORDERING_JANSSON
fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
return EXIT_AM_SKIP;
#endif
#if !WITH_JANSSON
fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
return EXIT_AM_SKIP;
......
......@@ -76,6 +76,11 @@ mymain(void)
int ret = 0;
testQemuCommandBuildObjectFromJSONData data1;
#if !WITH_STABLE_ORDERING_JANSSON
fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
return EXIT_AM_SKIP;
#endif
#if !WITH_JANSSON
fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
return EXIT_AM_SKIP;
......
......@@ -589,6 +589,11 @@ mymain(void)
struct qemuHotplugTestData data = {0};
struct testQemuHotplugCpuParams cpudata;
#if !WITH_STABLE_ORDERING_JANSSON
fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
return EXIT_AM_SKIP;
#endif
#if !WITH_JANSSON
fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
return EXIT_AM_SKIP;
......
......@@ -203,6 +203,11 @@ mymain(void)
virQEMUDriver driver;
int ret = 0;
#if !WITH_STABLE_ORDERING_JANSSON
fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
return EXIT_AM_SKIP;
#endif
#if !WITH_JANSSON
fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
return EXIT_AM_SKIP;
......
......@@ -2863,6 +2863,11 @@ mymain(void)
virJSONValuePtr metaschema = NULL;
char *metaschemastr = NULL;
#if !WITH_STABLE_ORDERING_JANSSON
fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
return EXIT_AM_SKIP;
#endif
#if !WITH_JANSSON
fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
return EXIT_AM_SKIP;
......
......@@ -479,6 +479,11 @@ mymain(void)
{
int ret = 0;
#if !WITH_STABLE_ORDERING_JANSSON
fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
return EXIT_AM_SKIP;
#endif
#define DO_TEST_FULL(name, cmd, doc, expect, pass) \
do { \
struct testInfo info = { doc, expect, pass }; \
......
......@@ -157,6 +157,11 @@ mymain(void)
int ret = 0;
virMacMapPtr mgr = NULL;
#if !WITH_STABLE_ORDERING_JANSSON
fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
return EXIT_AM_SKIP;
#endif
#define DO_TEST_BASIC(f, d, ...) \
do { \
const char * const m[] = {__VA_ARGS__, NULL }; \
......
......@@ -375,6 +375,11 @@ mymain(void)
int ret = 0;
const char *server_names[] = { "testServer0", "testServer1" };
# if !WITH_STABLE_ORDERING_JANSSON
fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
return EXIT_AM_SKIP;
# endif
if (virInitialize() < 0 ||
virEventRegisterDefaultImpl() < 0) {
virDispatchError(NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册