[libvirt PATCH 12/20] tests: depend on WITH_JSON_C instead of WITH_YAJL

Ján Tomko posted 20 patches 3 months, 1 week ago
There is a newer version of this series
[libvirt PATCH 12/20] tests: depend on WITH_JSON_C instead of WITH_YAJL
Posted by Ján Tomko 3 months, 1 week ago
After the series finale, there will be no WITH_YAJL anymore.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
 tests/meson.build        | 6 +++---
 tests/virnetdaemontest.c | 2 +-
 tests/virstoragetest.c   | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/meson.build b/tests/meson.build
index d1fc122fc7..d6e73bfba0 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -330,7 +330,7 @@ if host_machine.system() == 'linux'
     { 'name': 'virscsitest' },
     { 'name': 'virusbtest' },
   ]
-  if conf.has('WITH_YAJL')
+  if conf.has('WITH_JSON_C')
     tests += [
       { 'name': 'virnetdevopenvswitchtest' },
     ]
@@ -407,7 +407,7 @@ if conf.has('WITH_NETWORK')
   ]
 endif
 
-if conf.has('WITH_NODE_DEVICES') and conf.has('WITH_YAJL')
+if conf.has('WITH_NODE_DEVICES') and conf.has('WITH_JSON_C')
   tests += [
     { 'name': 'nodedevmdevctltest', 'link_with': [ node_device_driver_impl ] },
   ]
@@ -556,7 +556,7 @@ if conf.has('WITH_VMX')
   ]
 endif
 
-if conf.has('WITH_YAJL')
+if conf.has('WITH_JSON_C')
   tests += [
     { 'name': 'virjsontest' },
     { 'name': 'virmacmaptest' },
diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c
index 74c20479d4..3c00c55c72 100644
--- a/tests/virnetdaemontest.c
+++ b/tests/virnetdaemontest.c
@@ -26,7 +26,7 @@
 
 #define VIR_FROM_THIS VIR_FROM_RPC
 
-#if !defined(WIN32) && defined(WITH_YAJL)
+#if !defined(WIN32) && defined(WITH_JSON_C)
 struct testClientPriv {
     int magic;
 };
diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
index d07a05d04b..91c389dead 100644
--- a/tests/virstoragetest.c
+++ b/tests/virstoragetest.c
@@ -815,7 +815,7 @@ mymain(void)
                             "  <host name='example.org' port='1234'/>\n"
                             "</source>\n", 1);
 
-#ifdef WITH_YAJL
+#ifdef WITH_JSON_C
     TEST_BACKING_PARSE("json:", NULL);
     TEST_BACKING_PARSE("json:asdgsdfg", NULL);
     TEST_BACKING_PARSE("json:{}", NULL);
@@ -1192,7 +1192,7 @@ mymain(void)
                         "  <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>\n"
                         "</source>\n");
 
-#endif /* WITH_YAJL */
+#endif /* WITH_JSON_C */
 
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
 }
-- 
2.45.2
Re: [libvirt PATCH 12/20] tests: depend on WITH_JSON_C instead of WITH_YAJL
Posted by Peter Krempa 3 months ago
On Wed, Aug 14, 2024 at 23:40:27 +0200, Ján Tomko wrote:
> After the series finale, there will be no WITH_YAJL anymore.
> 
> Signed-off-by: Ján Tomko <jtomko@redhat.com>
> ---
>  tests/meson.build        | 6 +++---
>  tests/virnetdaemontest.c | 2 +-
>  tests/virstoragetest.c   | 4 ++--
>  3 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/meson.build b/tests/meson.build
> index d1fc122fc7..d6e73bfba0 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -330,7 +330,7 @@ if host_machine.system() == 'linux'
>      { 'name': 'virscsitest' },
>      { 'name': 'virusbtest' },
>    ]
> -  if conf.has('WITH_YAJL')
> +  if conf.has('WITH_JSON_C')

Shouldn't we introduce "WITH_JSON" and use that across these checks? The
specific library-dependant defines can be then used where it actually
matters.

The above may be useful also in other cases such as if you'll want to
fix the rollover to the new library in the '*nss*' files which do not
get an interim implementation with both YAJL and json-c.