[Nagiosplug-checkins] SF.net SVN: nagiosplug:[2106] nagiosplug/trunk
dermoth at users.sourceforge.net
dermoth at users.sourceforge.net
Mon Dec 1 13:28:34 CET 2008
Revision: 2106
http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=2106&view=rev
Author: dermoth
Date: 2008-12-01 12:28:34 +0000 (Mon, 01 Dec 2008)
Log Message:
-----------
Revert inclusion of libtap into nagiosplugins
(except for the NEWS file)
This reverts the following commits (latest first): f3e0909, 9f16b54, be8df51, f31cd40, 5270c7d, a25083f, f1bfe40, c503d85 and 6c476db
Modified Paths:
--------------
nagiosplug/trunk/Makefile.am
nagiosplug/trunk/configure.in
nagiosplug/trunk/lib/tests/Makefile.am
nagiosplug/trunk/lib/tests/test_utils.c
nagiosplug/trunk/tools/setup
Added Paths:
-----------
nagiosplug/trunk/lib/tests/test_base64.t
nagiosplug/trunk/lib/tests/test_cmd.t
nagiosplug/trunk/lib/tests/test_disk.t
nagiosplug/trunk/lib/tests/test_ini.t
nagiosplug/trunk/lib/tests/test_opts.t
nagiosplug/trunk/lib/tests/test_tcp.t
nagiosplug/trunk/lib/tests/test_utils.t
Removed Paths:
-------------
nagiosplug/trunk/external/README
nagiosplug/trunk/external/tap-1.01-nagios-plugins.tar.gz
nagiosplug/trunk/lib/tests/test_all.t
Modified: nagiosplug/trunk/Makefile.am
===================================================================
--- nagiosplug/trunk/Makefile.am 2008-11-27 14:17:23 UTC (rev 2105)
+++ nagiosplug/trunk/Makefile.am 2008-12-01 12:28:34 UTC (rev 2106)
@@ -1,16 +1,14 @@
## Process this file with automake to produce Makefile.in
-SUBDIRS = gl @INCLUDE_TAP_DIR@ lib plugins plugins-scripts plugins-root po @PERLMODS_DIR@
+SUBDIRS = gl lib plugins plugins-scripts plugins-root po @PERLMODS_DIR@
-# Have to list TAP_DIR manually to get in distribution
EXTRA_DIST = config.rpath \
ABOUT-NLS ACKNOWLEDGEMENTS AUTHORS BUGS CODING FAQ LEGAL NEWS \
NP-VERSION-GEN REQUIREMENTS SUPPORT THANKS \
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 \
- external/tap-1.01
+ tools/tinderbox_build
ACLOCAL_AMFLAGS = -I gl/m4 -I m4
@@ -24,9 +22,6 @@
install-root:
cd plugins-root && $(MAKE) $@
-tap:
- cd @TAP_DIR@ && $(MAKE)
-
test test-debug:
cd lib && $(MAKE) $@
if test "$(PERLMODS_DIR)" != ""; then cd perlmods && $(MAKE) $@; fi
Modified: nagiosplug/trunk/configure.in
===================================================================
--- nagiosplug/trunk/configure.in 2008-11-27 14:17:23 UTC (rev 2105)
+++ nagiosplug/trunk/configure.in 2008-12-01 12:28:34 UTC (rev 2106)
@@ -156,25 +156,11 @@
AC_CHECK_LIB(m,floor,MATHLIBS="-lm")
AC_SUBST(MATHLIBS)
-dnl Add libtap for tests
-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])
- dnl This is required so that TAP stuff is compiled before the libs and tests
- dnl A make install will also install the tap library, but as this is a development tool, this should be okay
- INCLUDE_TAP_DIR=$TAP_DIR
- AC_SUBST(INCLUDE_TAP_DIR)
+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)
-fi
+ )
dnl INI Parsing
AC_ARG_ENABLE(extra-opts,
@@ -184,11 +170,9 @@
[enable_extra_opts=no])
AM_CONDITIONAL([USE_PARSE_INI],[test "$enable_extra_opts" = "yes"])
if test "$enable_extra_opts" = "yes" ; then
+ EXTRA_TEST="$EXTRA_TEST test_ini test_opts"
+ AC_SUBST(EXTRA_TEST)
AC_DEFINE(NP_EXTRA_OPTS,[1],[Enable INI file parsing.])
- if test "$enable_libtap" = yes; then
- EXTRA_TEST="$EXTRA_TEST test_ini test_opts"
- AC_SUBST(EXTRA_TEST)
- fi
fi
dnl Check for PostgreSQL libraries
Deleted: nagiosplug/trunk/external/README
===================================================================
--- nagiosplug/trunk/external/README 2008-11-27 14:17:23 UTC (rev 2105)
+++ nagiosplug/trunk/external/README 2008-12-01 12:28:34 UTC (rev 2106)
@@ -1,4 +0,0 @@
-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)
Deleted: nagiosplug/trunk/external/tap-1.01-nagios-plugins.tar.gz
===================================================================
(Binary files differ)
Modified: nagiosplug/trunk/lib/tests/Makefile.am
===================================================================
--- nagiosplug/trunk/lib/tests/Makefile.am 2008-11-27 14:17:23 UTC (rev 2105)
+++ nagiosplug/trunk/lib/tests/Makefile.am 2008-12-01 12:28:34 UTC (rev 2106)
@@ -5,36 +5,54 @@
TESTS = @EXTRA_TEST@
check_PROGRAMS = @EXTRA_TEST@
-TAP_LIB_DIR = $(top_srcdir)/@TAP_DIR@/src
-TAP_O = $(TAP_LIB_DIR)/tap.o $(TAP_LIB_DIR)/../lib/libgnu.la
-INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins -I$(TAP_LIB_DIR)
+INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins
EXTRA_PROGRAMS = test_utils test_disk test_tcp test_cmd test_base64 test_ini test_opts
+np_test_scripts = test_base64.t test_cmd.t test_disk.t test_ini.t test_opts.t test_tcp.t test_utils.t
np_test_files = config-dos.ini config-opts.ini config-tiny.ini plugin.ini plugins.ini
-EXTRA_DIST = test_all.t $(np_test_files)
+EXTRA_DIST = $(np_test_scripts) $(np_test_files)
-AM_CFLAGS = -g -I..
-
LIBS = @LIBINTL@
-test_utils_LDADD = ../utils_base.o $(TAP_O)
+test_utils_SOURCES = test_utils.c
+test_utils_CFLAGS = -g -I..
+test_utils_LDFLAGS = -L/usr/local/lib -ltap
+test_utils_LDADD = ../utils_base.o
-test_disk_LDADD = ../utils_disk.o $(top_srcdir)/gl/libgnu.a $(TAP_O)
+test_disk_SOURCES = test_disk.c
+test_disk_CFLAGS = -g -I..
+test_disk_LDFLAGS = -L/usr/local/lib -ltap
+test_disk_LDADD = ../utils_disk.o $(top_srcdir)/gl/libgnu.a
-test_tcp_LDADD = ../utils_tcp.o $(TAP_O)
+test_tcp_SOURCES = test_tcp.c
+test_tcp_CFLAGS = -g -I..
+test_tcp_LDFLAGS = -L/usr/local/lib -ltap
+test_tcp_LDADD = ../utils_tcp.o
-test_cmd_LDADD = ../utils_cmd.o ../utils_base.o $(TAP_O)
+test_cmd_SOURCES = test_cmd.c
+test_cmd_CFLAGS = -g -I..
+test_cmd_LDFLAGS = -L/usr/local/lib -ltap
+test_cmd_LDADD = ../utils_cmd.o ../utils_base.o
-test_base64_LDADD = $(top_srcdir)/gl/base64.o $(TAP_O)
+test_base64_SOURCES = test_base64.c
+test_base64_CFLAGS = -g -I..
+test_base64_LDFLAGS = -L/usr/local/lib -ltap
+test_base64_LDADD = $(top_srcdir)/gl/base64.o
-test_ini_LDADD = ../utils_base.o ../parse_ini.o $(TAP_O)
+test_ini_SOURCES = test_ini.c
+test_ini_CFLAGS = -g -I..
+test_ini_LDFLAGS = -L/usr/local/lib -ltap
+test_ini_LDADD = ../utils_base.o ../parse_ini.o
-test_opts_LDADD = ../utils_base.o ../parse_ini.o ../extra_opts.o $(TAP_O)
+test_opts_SOURCES = test_opts.c
+test_opts_CFLAGS = -g -I..
+test_opts_LDFLAGS = -L/usr/local/lib -ltap
+test_opts_LDADD = ../utils_base.o ../parse_ini.o ../extra_opts.o
test: ${noinst_PROGRAMS}
- perl ./test_all.t $(EXTRA_PROGRAMS)
+ perl -MTest::Harness -e '$$Test::Harness::switches=""; runtests(map {$$_ .= ".t"} @ARGV)' $(EXTRA_PROGRAMS)
test-debug: ${noinst_PROGRAMS}
- perl ./test_all.t -v $(EXTRA_PROGRAMS)
+ perl -MTest::Harness -e '$$Test::Harness::verbose=1; $$Test::Harness::switches=""; runtests(map {$$_ .= ".t"} @ARGV)' $(EXTRA_PROGRAMS)
Deleted: nagiosplug/trunk/lib/tests/test_all.t
===================================================================
--- nagiosplug/trunk/lib/tests/test_all.t 2008-11-27 14:17:23 UTC (rev 2105)
+++ nagiosplug/trunk/lib/tests/test_all.t 2008-12-01 12:28:34 UTC (rev 2106)
@@ -1,38 +0,0 @@
-#!/usr/bin/perl
-# Creates $file.t for each @ARGV
-# Then calls runtests for all these files
-
-use strict;
-use Test::Harness;
-use Getopt::Std;
-
-my $opts = {};
-getopts("v", $opts) or die "Getopt failed";
-
-$Test::Harness::verbose = $opts->{v};
-$Test::Harness::switches="";
-
-my $special_errors = {
- test_ini => "please enable parse-ini to test",
- test_opts => "please enable parse-ini to test",
-};
-my $default_error = "could not compile";
-
-my @tests;
-foreach my $file (@ARGV) {
- my $file_t = "$file.t";
- my $error = $special_errors->{ $file } || $default_error;
- open F, ">", $file_t or die "Cannot open $file_t for writing";
- print F <<EOF;
-use Test::More;
-if (! -e "$file") {
- plan skip_all => "./$file not compiled - $error";
-}
-exec "./$file";
-EOF
- close F;
- push @tests, $file_t;
-}
-chmod 0750, @tests;
-runtests @tests;
-unlink @tests;
Added: nagiosplug/trunk/lib/tests/test_base64.t
===================================================================
--- nagiosplug/trunk/lib/tests/test_base64.t (rev 0)
+++ nagiosplug/trunk/lib/tests/test_base64.t 2008-12-01 12:28:34 UTC (rev 2106)
@@ -0,0 +1,6 @@
+#!/usr/bin/perl
+use Test::More;
+if (! -e "./test_base64") {
+ plan skip_all => "./test_base64 not compiled - please install tap library to test";
+}
+exec "./test_base64";
Property changes on: nagiosplug/trunk/lib/tests/test_base64.t
___________________________________________________________________
Added: svn:executable
+ *
Added: nagiosplug/trunk/lib/tests/test_cmd.t
===================================================================
--- nagiosplug/trunk/lib/tests/test_cmd.t (rev 0)
+++ nagiosplug/trunk/lib/tests/test_cmd.t 2008-12-01 12:28:34 UTC (rev 2106)
@@ -0,0 +1,6 @@
+#!/usr/bin/perl
+use Test::More;
+if (! -e "./test_cmd") {
+ plan skip_all => "./test_cmd not compiled - please install tap library to test";
+}
+exec "./test_cmd";
Added: nagiosplug/trunk/lib/tests/test_disk.t
===================================================================
--- nagiosplug/trunk/lib/tests/test_disk.t (rev 0)
+++ nagiosplug/trunk/lib/tests/test_disk.t 2008-12-01 12:28:34 UTC (rev 2106)
@@ -0,0 +1,6 @@
+#!/usr/bin/perl
+use Test::More;
+if (! -e "./test_disk") {
+ plan skip_all => "./test_disk not compiled - please install tap library to test";
+}
+exec "./test_disk";
Property changes on: nagiosplug/trunk/lib/tests/test_disk.t
___________________________________________________________________
Added: svn:executable
+ *
Added: nagiosplug/trunk/lib/tests/test_ini.t
===================================================================
--- nagiosplug/trunk/lib/tests/test_ini.t (rev 0)
+++ nagiosplug/trunk/lib/tests/test_ini.t 2008-12-01 12:28:34 UTC (rev 2106)
@@ -0,0 +1,6 @@
+#!/usr/bin/perl
+use Test::More;
+if (! -e "./test_ini") {
+ plan skip_all => "./test_ini not compiled - please install tap library and/or enable parse-ini to test";
+}
+exec "./test_ini";
Property changes on: nagiosplug/trunk/lib/tests/test_ini.t
___________________________________________________________________
Added: svn:executable
+ *
Added: nagiosplug/trunk/lib/tests/test_opts.t
===================================================================
--- nagiosplug/trunk/lib/tests/test_opts.t (rev 0)
+++ nagiosplug/trunk/lib/tests/test_opts.t 2008-12-01 12:28:34 UTC (rev 2106)
@@ -0,0 +1,6 @@
+#!/usr/bin/perl
+use Test::More;
+if (! -e "./test_opts") {
+ plan skip_all => "./test_opts not compiled - please install tap library and/or enable parse-ini to test";
+}
+exec "./test_opts";
Property changes on: nagiosplug/trunk/lib/tests/test_opts.t
___________________________________________________________________
Added: svn:executable
+ *
Added: nagiosplug/trunk/lib/tests/test_tcp.t
===================================================================
--- nagiosplug/trunk/lib/tests/test_tcp.t (rev 0)
+++ nagiosplug/trunk/lib/tests/test_tcp.t 2008-12-01 12:28:34 UTC (rev 2106)
@@ -0,0 +1,6 @@
+#!/usr/bin/perl
+use Test::More;
+if (! -e "./test_tcp") {
+ plan skip_all => "./test_tcp not compiled - please install tap library to test";
+}
+exec "./test_tcp";
Property changes on: nagiosplug/trunk/lib/tests/test_tcp.t
___________________________________________________________________
Added: svn:executable
+ *
Modified: nagiosplug/trunk/lib/tests/test_utils.c
===================================================================
--- nagiosplug/trunk/lib/tests/test_utils.c 2008-11-27 14:17:23 UTC (rev 2105)
+++ nagiosplug/trunk/lib/tests/test_utils.c 2008-12-01 12:28:34 UTC (rev 2106)
@@ -29,7 +29,7 @@
thresholds *thresholds = NULL;
int rc;
- plan_tests(81);
+ plan_tests(82);
range = parse_range_string("6");
ok( range != NULL, "'6' is valid range");
@@ -173,5 +173,8 @@
ok( strcmp(test, "everything") == 0, "everything okay");
free(test);
+ test = basename("/here/is/a/path");
+ ok( strcmp(test, "path") == 0, "basename okay");
+
return exit_status();
}
Added: nagiosplug/trunk/lib/tests/test_utils.t
===================================================================
--- nagiosplug/trunk/lib/tests/test_utils.t (rev 0)
+++ nagiosplug/trunk/lib/tests/test_utils.t 2008-12-01 12:28:34 UTC (rev 2106)
@@ -0,0 +1,6 @@
+#!/usr/bin/perl
+use Test::More;
+if (! -e "./test_utils") {
+ plan skip_all => "./test_utils not compiled - please install tap library to test";
+}
+exec "./test_utils";
Property changes on: nagiosplug/trunk/lib/tests/test_utils.t
___________________________________________________________________
Added: svn:executable
+ *
Modified: nagiosplug/trunk/tools/setup
===================================================================
--- nagiosplug/trunk/tools/setup 2008-11-27 14:17:23 UTC (rev 2105)
+++ nagiosplug/trunk/tools/setup 2008-12-01 12:28:34 UTC (rev 2106)
@@ -48,6 +48,3 @@
if [ $docbook = 1 ] ; then
( cd doc && make )
fi
-
-# Untar libtap
-( cd external && gunzip -c tap-1.01-nagios-plugins.tar.gz | tar -xf - )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list