mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-02-03 18:49:29 -05:00
Adding libtap into distribution to help run C based tests
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2013 f882894a-f735-0410-b71e-b25c423dba1c
This commit is contained in:
parent
2968a166e2
commit
6c476db6dc
7 changed files with 38 additions and 17 deletions
|
|
@ -8,7 +8,7 @@ EXTRA_DIST = config.rpath \
|
|||
NPTest.pm contrib pkg nagios-plugins.spec \
|
||||
config_test/Makefile config_test/run_tests config_test/child_test.c \
|
||||
perlmods tools/build_perl_modules \
|
||||
tools/tinderbox_build
|
||||
tools/tinderbox_build @TAP_DIR@
|
||||
|
||||
ACLOCAL_AMFLAGS = -I gl/m4 -I m4
|
||||
|
||||
|
|
@ -22,7 +22,10 @@ dist-hook:
|
|||
install-root:
|
||||
cd plugins-root && $(MAKE) $@
|
||||
|
||||
test test-debug:
|
||||
tap:
|
||||
cd @TAP_DIR@ && $(MAKE)
|
||||
|
||||
test test-debug: tap
|
||||
cd lib && $(MAKE) $@
|
||||
if test "$(PERLMODS_DIR)" != ""; then cd perlmods && $(MAKE) $@; fi
|
||||
cd plugins && $(MAKE) $@
|
||||
|
|
|
|||
21
configure.in
21
configure.in
|
|
@ -154,12 +154,6 @@ AC_CHECK_HEADERS(math.h)
|
|||
AC_CHECK_LIB(m,floor,MATHLIBS="-lm")
|
||||
AC_SUBST(MATHLIBS)
|
||||
|
||||
dnl Check for libtap, to run perl-like tests
|
||||
AC_CHECK_LIB(tap, plan_tests,
|
||||
EXTRA_TEST="test_utils test_disk test_tcp test_cmd test_base64"
|
||||
AC_SUBST(EXTRA_TEST)
|
||||
)
|
||||
|
||||
dnl INI Parsing
|
||||
AC_ARG_ENABLE(extra-opts,
|
||||
AC_HELP_STRING([--enable-extra-opts],
|
||||
|
|
@ -1595,6 +1589,21 @@ if test "$ac_cv_uname_s" = 'SunOS' -a \( "x$ac_cv_prog_ac_ct_AR" = "x" -o "$ac_c
|
|||
AC_MSG_ERROR(No ar found for Solaris - is /usr/ccs/bin in PATH?)
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(libtap,
|
||||
AC_HELP_STRING([--enable-libtap],
|
||||
[Enables configuring of libtap in external/tap/. Run "make tap" to compile (default: no)]),
|
||||
[enable_libtap=$enableval],
|
||||
[enable_libtap=no])
|
||||
dnl Have to define TAP_DIR so that Makefile can pull it as an extra dist
|
||||
TAP_DIR=external/tap-1.01
|
||||
AC_SUBST(TAP_DIR)
|
||||
if test "$enable_libtap" = yes; then
|
||||
dnl Have to have AC_CONFIG_SUBDIRS as a literal
|
||||
AC_CONFIG_SUBDIRS([external/tap-1.01])
|
||||
EXTRA_TEST="test_utils test_disk test_tcp test_cmd test_base64"
|
||||
AC_SUBST(EXTRA_TEST)
|
||||
fi
|
||||
|
||||
AC_OUTPUT(
|
||||
Makefile
|
||||
lib/Makefile
|
||||
|
|
|
|||
4
external/README
vendored
Normal file
4
external/README
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
Changes to tap-1.01.tar.gz from http://jc.ngo.org.uk/trac-bin/trac.cgi/wiki/LibTap:
|
||||
|
||||
Added vasprintf from gnulib (see http://jc.ngo.org.uk/trac-bin/trac.cgi/ticket/32)
|
||||
Added -UHAVE_LIBPTHREAD (see http://nagiosplugins.org/faq/libtap)
|
||||
BIN
external/tap-1.01-altinity.tar.gz
vendored
Normal file
BIN
external/tap-1.01-altinity.tar.gz
vendored
Normal file
Binary file not shown.
|
|
@ -15,39 +15,41 @@ EXTRA_DIST = $(np_test_scripts) $(np_test_files)
|
|||
|
||||
LIBS = @LIBINTL@
|
||||
|
||||
TAP_LIB_DIR = $(top_srcdir)/@TAP_DIR@/src
|
||||
|
||||
test_utils_SOURCES = test_utils.c
|
||||
test_utils_CFLAGS = -g -I..
|
||||
test_utils_LDFLAGS = -L/usr/local/lib -ltap
|
||||
test_utils_LDFLAGS = -L$(TAP_LIB_DIR) -ltap
|
||||
test_utils_LDADD = ../utils_base.o
|
||||
|
||||
test_disk_SOURCES = test_disk.c
|
||||
test_disk_CFLAGS = -g -I..
|
||||
test_disk_LDFLAGS = -L/usr/local/lib -ltap
|
||||
test_disk_LDFLAGS = -L$(TAP_LIB_DIR) -ltap
|
||||
test_disk_LDADD = ../utils_disk.o $(top_srcdir)/gl/libgnu.a
|
||||
|
||||
test_tcp_SOURCES = test_tcp.c
|
||||
test_tcp_CFLAGS = -g -I..
|
||||
test_tcp_LDFLAGS = -L/usr/local/lib -ltap
|
||||
test_tcp_LDFLAGS = -L$(TAP_LIB_DIR) -ltap
|
||||
test_tcp_LDADD = ../utils_tcp.o
|
||||
|
||||
test_cmd_SOURCES = test_cmd.c
|
||||
test_cmd_CFLAGS = -g -I..
|
||||
test_cmd_LDFLAGS = -L/usr/local/lib -ltap
|
||||
test_cmd_LDFLAGS = -L$(TAP_LIB_DIR) -ltap
|
||||
test_cmd_LDADD = ../utils_cmd.o ../utils_base.o
|
||||
|
||||
test_base64_SOURCES = test_base64.c
|
||||
test_base64_CFLAGS = -g -I..
|
||||
test_base64_LDFLAGS = -L/usr/local/lib -ltap
|
||||
test_base64_LDFLAGS = -L$(TAP_LIB_DIR) -ltap
|
||||
test_base64_LDADD = $(top_srcdir)/gl/base64.o
|
||||
|
||||
test_ini_SOURCES = test_ini.c
|
||||
test_ini_CFLAGS = -g -I..
|
||||
test_ini_LDFLAGS = -L/usr/local/lib -ltap
|
||||
test_ini_LDFLAGS = -L$(TAP_LIB_DIR) -ltap
|
||||
test_ini_LDADD = ../utils_base.o ../parse_ini.o
|
||||
|
||||
test_opts_SOURCES = test_opts.c
|
||||
test_opts_CFLAGS = -g -I..
|
||||
test_opts_LDFLAGS = -L/usr/local/lib -ltap
|
||||
test_opts_LDFLAGS = -L$(TAP_LIB_DIR) -ltap
|
||||
test_opts_LDADD = ../utils_base.o ../parse_ini.o ../extra_opts.o
|
||||
|
||||
test: ${noinst_PROGRAMS}
|
||||
|
|
|
|||
|
|
@ -49,3 +49,6 @@ fi
|
|||
if [ $docbook = 1 ] ; then
|
||||
cd doc && make
|
||||
fi
|
||||
|
||||
# Untar libtap
|
||||
cd external && tar --gzip -xf tap-1.01-altinity.tar.gz
|
||||
|
|
|
|||
|
|
@ -242,8 +242,8 @@ sub SetupPath {
|
|||
|
||||
sub configure {
|
||||
# Configure
|
||||
print LOG "./configure $ConfigureArgs\n";
|
||||
open (CONFIGURE, "./configure $ConfigureArgs 2>&1 |") || die "../configure: $!\n";
|
||||
print LOG "./configure --enable-libtap $ConfigureArgs\n";
|
||||
open (CONFIGURE, "./configure --enable-libtap $ConfigureArgs 2>&1 |") || die "../configure: $!\n";
|
||||
while (<CONFIGURE>) {
|
||||
print $_;
|
||||
print LOG $_;
|
||||
|
|
|
|||
Loading…
Reference in a new issue