From 8fe8df4b2026ca21db123ddc0cdd8451a2e224dd Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Thu, 18 Jun 2020 02:02:30 +0200 Subject: [PATCH] meson: tests: build commandhelper binary Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa Reviewed-by: Neal Gompa --- tests/Makefile.am | 14 +------------- tests/meson.build | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index a8fea66f1d..d33b51d7f3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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) diff --git a/tests/meson.build b/tests/meson.build index 5cbd3cd207..fa116a0e24 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -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, + ], +)