]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: tests: build helper binaries
authorPavel Hrdina <phrdina@redhat.com>
Mon, 27 Jul 2020 09:41:52 +0000 (11:41 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:06 +0000 (09:27 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
tests/Makefile.am
tests/meson.build

index 75201e1ebe187a76713319f440fb2a3f2fe22855..e691919c99550fec0363e2d7fbb603a6c6d66fc4 100644 (file)
 ## License along with this library.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-if WITH_QEMU
-test_helpers += qemucapsprobe
-endif WITH_QEMU
-
-if WITH_NSS
-test_helpers += nsslinktest nssguestlinktest
-endif WITH_NSS
-
 test_scripts =
 libvirtd_test_scripts = \
        libvirtd-fail \
@@ -67,8 +59,6 @@ file-access-clean:
        > test_file_access.txt
 endif WITH_LINUX
 
-noinst_PROGRAMS = $(test_helpers)
-
 TESTS = $(test_scripts)
 
 VALGRIND = valgrind --quiet --leak-check=full --trace-children=yes \
@@ -76,29 +66,3 @@ VALGRIND = valgrind --quiet --leak-check=full --trace-children=yes \
        --suppressions=$(abs_srcdir)/.valgrind.supp
 valgrind:
        $(MAKE) check VG="$(LIBTOOL) --mode=execute $(VALGRIND)"
-
-if WITH_QEMU
-qemucapsprobe_SOURCES = \
-       qemucapsprobe.c
-qemucapsprobe_LDADD = \
-       libqemutestdriver.la $(LDADDS)
-endif WITH_QEMU
-
-if WITH_NSS
-## Intentionaly not linking with anything else.
-## See the test source for more detailed explanation.
-nsslinktest_SOURCES = nsslinktest.c
-nsslinktest_CFLAGS = \
-       $(AM_CFLAGS) \
-       -I$(top_srcdir)/tools/nss
-nsslinktest_LDADD = ../tools/nss/libnss_libvirt_impl.la
-nsslinktest_LDFLAGS = $(NULL)
-
-nssguestlinktest_SOURCES = nsslinktest.c
-nssguestlinktest_CFLAGS = \
-       -DLIBVIRT_NSS_GUEST \
-       $(AM_CFLAGS) \
-       -I$(top_srcdir)/tools/nss
-nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la
-nssguestlinktest_LDFLAGS = $(NULL)
-endif WITH_NSS
index d1f35d9a48b24727bc14b91ced36709a6e6c853d..cd59730d213f6fb49d98c2a782a0f7f75069b49f 100644 (file)
@@ -591,6 +591,34 @@ endforeach
 
 helpers = []
 
+if conf.has('WITH_NSS')
+  helpers += [
+    # Intentionaly not linking with anything else.
+    # See the test source for more detailed explanation.
+    {
+      'name': 'nsslinktest',
+      'include': [ nss_inc_dir ],
+      'link_with': [ nss_libvirt_impl ],
+    },
+    {
+      'name': 'nssguestlinktest',
+      'sources': [ 'nsslinktest.c' ],
+      'c_args': [ '-DLIBVIRT_NSS_GUEST' ],
+      'include': [ nss_inc_dir ],
+      'link_with': [ nss_libvirt_guest_impl ],
+    },
+  ]
+endif
+
+if conf.has('WITH_QEMU')
+  helpers += [
+    {
+      'name': 'qemucapsprobe',
+      'link_with': [ test_qemu_driver_lib, libvirt_lib ],
+    },
+  ]
+endif
+
 foreach data : helpers
   helper_sources = '@0@.c'.format(data['name'])
   helper_bin = executable(