meson: tests: build commandhelper binary

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-06-18 02:02:30 +02:00
parent 401aa32fdb
commit 8fe8df4b20
2 changed files with 18 additions and 13 deletions

View File

@ -35,7 +35,7 @@ LDADDS = \
$(GLIB_LIBS) \
$(NULL)
test_helpers = commandhelper ssh
test_helpers = ssh
test_programs = virshtest sockettest \
virhostcputest virbuftest \
commandtest seclabeltest \
@ -754,18 +754,6 @@ commandtest_SOURCES = \
commandtest.c testutils.h testutils.c
commandtest_LDADD = $(LDADDS)
# Must not link to any libvirt modules - libc only
# otherwise external libraries might unexpectedly leak
# file descriptors into commandhelper invalidating the
# test logic assumptions
commandhelper_SOURCES = \
commandhelper.c
commandhelper_LDADD = \
$(NO_INDIRECT_LDFLAGS)
commandhelper_LDFLAGS = -static
virkmodtest_SOURCES = \
virkmodtest.c testutils.h testutils.c
virkmodtest_LDADD = $(LDADDS)

View File

@ -170,3 +170,20 @@ test_file_wrapper_lib = static_library(
[ 'virfilewrapper.c' ],
dependencies: [ tests_dep ],
)
# build helpers used by tests
# Must not link to any libvirt modules - libc only otherwise external
# libraries might unexpectedly leak file descriptors into commandhelper
# invalidating the test logic assumptions.
executable(
'commandhelper',
[ 'commandhelper.c' ],
dependencies: [
tests_dep,
],
link_args: [
libvirt_no_indirect,
],
)