diff --git a/SRC/Makefile.am b/SRC/Makefile.am index 37d9203..2cf249f 100644 --- a/SRC/Makefile.am +++ b/SRC/Makefile.am @@ -9,6 +9,11 @@ echoping_LDADD = EXTRA_DIST = $(man_MANS) +TESTS=test-echoping-local test-echoping-remote test-echoping-icp + +test: check +tests: check + ## Otherwise, we depend on GNUmake, but for CVS users, not for regular ## tarball users ##AUTOMAKE_OPTIONS = no-dependencies diff --git a/SRC/Makefile.in b/SRC/Makefile.in index 07e18b1..7a1660d 100644 --- a/SRC/Makefile.in +++ b/SRC/Makefile.in @@ -70,6 +70,8 @@ echoping_SOURCES = echoping.c error.c readline.c writen.c util.c http.c icp.c HT echoping_LDADD = EXTRA_DIST = $(man_MANS) + +TESTS=test-echoping-local test-echoping-remote test-echoping-icp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h @@ -326,10 +328,35 @@ maintainer-clean-depend: @-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' \ < .deps/$(*F).p > .deps/$(*F).P @-rm -f .deps/$(*F).p +check-TESTS: $(TESTS) + @failed=0; all=0; \ + srcdir=$(srcdir); export srcdir; \ + for tst in $(TESTS); do \ + if test -f $$tst; then dir=.; \ + else dir="$(srcdir)"; fi; \ + if $(TESTS_ENVIRONMENT) $$dir/$$tst; then \ + all=`expr $$all + 1`; \ + echo "PASS: $$tst"; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="$$failed of $$all tests failed"; \ + fi; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0 info: dvi: check: all - $(MAKE) + $(MAKE) check-TESTS installcheck: install-exec: install-binPROGRAMS @$(NORMAL_INSTALL) @@ -388,11 +415,14 @@ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile install-man1 uninstall-man1 install-man \ uninstall-man tags mostlyclean-tags distclean-tags clean-tags \ maintainer-clean-tags distdir mostlyclean-depend distclean-depend \ -clean-depend maintainer-clean-depend info dvi installcheck install-exec \ -install-data install uninstall all installdirs mostlyclean-generic \ -distclean-generic clean-generic maintainer-clean-generic clean \ -mostlyclean distclean maintainer-clean +clean-depend maintainer-clean-depend check-TESTS info dvi installcheck \ +install-exec install-data install uninstall all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + +test: check +tests: check # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/SRC/test-echoping-icp b/SRC/test-echoping-icp new file mode 100755 index 0000000..67a0539 --- /dev/null +++ b/SRC/test-echoping-icp @@ -0,0 +1,12 @@ +#!/bin/sh + +echo "" +echo "Since this tests tries remote servers, a failure is not always " +echo " echoping's fault: it may be a network problem. Also, it depends on" +echo " a local ICP cache name 'cache'." + +echoping -i http://www.pasteur.fr/ cache + +echoping -i http://www.freenix.org/ cache + + diff --git a/SRC/test-echoping-local b/SRC/test-echoping-local new file mode 100755 index 0000000..50ab63d --- /dev/null +++ b/SRC/test-echoping-local @@ -0,0 +1,12 @@ +#!/bin/sh + +# $Id$ + +echo "" +echo "A message such as 'connection refused' is not always an error" +echo " you may not have an appropriate server." + +echoping localhost +echoping -d localhost +echoping -c localhost +#echoping -h / localhost diff --git a/SRC/test-echoping-remote b/SRC/test-echoping-remote new file mode 100755 index 0000000..e13c3af --- /dev/null +++ b/SRC/test-echoping-remote @@ -0,0 +1,10 @@ +#!/bin/sh + +echo "" +echo "Since this tests tries remote servers, a failure is not always " +echo " echoping's fault: it may be a network problem." + +echoping -h / www.pasteur.fr + +echoping -h / www.freenix.org +