From 6fcbbaafc4bae79d4e674a2cf7f1d87d5a471603 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Tue, 19 Dec 2023 11:28:35 +0100 Subject: Implement first unit test for check_swap --- plugins/Makefile.am | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'plugins/Makefile.am') diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 1ca7cf3f..8ef2a246 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -38,19 +38,27 @@ check_tcp_programs = check_ftp check_imap check_nntp check_pop \ EXTRA_PROGRAMS = check_mysql check_radius check_pgsql check_snmp check_hpjd \ check_swap check_fping check_ldap check_game check_dig \ check_nagios check_by_ssh check_dns check_nt check_ide_smart \ - check_procs check_mysql_query check_apt check_dbi check_curl + check_procs check_mysql_query check_apt check_dbi check_curl \ + \ + tests/test_check_swap SUBDIRS = picohttpparser -EXTRA_DIST = t tests +np_test_scripts = tests/test_check_swap.t + +EXTRA_DIST = t tests $(np_test_scripts) PLUGINHDRS = common.h noinst_LIBRARIES = libnpcommon.a +noinst_PROGRAMS = @EXTRA_PLUGIN_TESTS@ +# These two lines support "make check", but we use "make test" +check_PROGRAMS = @EXTRA_PLUGIN_TESTS@ libnpcommon_a_SOURCES = utils.c netutils.c sslutils.c runcmd.c \ popen.c utils.h netutils.h popen.h common.h runcmd.c runcmd.h + BASEOBJS = libnpcommon.a ../lib/libmonitoringplug.a ../gl/libgnu.a $(LIB_CRYPTO) NETOBJS = $(BASEOBJS) $(EXTRA_NETOBLS) NETLIBS = $(NETOBJS) $(SOCKETLIBS) @@ -58,7 +66,10 @@ SSLOBJS = $(BASEOBJS) $(NETLIBS) $(SSLLIBS) $(LIB_CRYPTO) TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir) -TESTS = @PLUGIN_TEST@ +tap_ldflags = -L$(top_srcdir)/tap + +TESTS = @PLUGIN_TEST@ @EXTRA_PLUGIN_TESTS@ + test: perl -I $(top_builddir) -I $(top_srcdir) ../test.pl @@ -122,6 +133,8 @@ if !HAVE_UTMPX check_users_LDADD += popen.o endif +tests_test_check_swap_LDADD = $(BASEOBJS) check_swap.d/swap.o $(tap_ldflags) -ltap + ############################################################################## # secondary dependencies -- cgit v1.2.3-74-g34f1