meson: tests: build helper binaries

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Pavel Hrdina 2020-07-27 11:41:52 +02:00
parent c1cfbe62e5
commit db33df7d0f
2 changed files with 28 additions and 36 deletions

View File

@ -16,14 +16,6 @@
## 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

View 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(