From 829f83bf5bce33e856971b55a8e00c3560da7b4b Mon Sep 17 00:00:00 2001 From: micah Date: Wed, 11 Jul 2007 23:10:48 -0700 Subject: [PATCH] [svn] Merging fix for b20431: automated testing via "make test". --- Makefile.in | 2 +- configure.in | 3 +- tests/FTPTest.pm | 4 +-- tests/HTTPTest.pm | 4 +-- tests/Makefile.in | 37 ++++++++++++++++++++++-- tests/Test--spider-fail.px | 4 +-- tests/Test--spider-r.px | 4 +-- tests/Test--spider.px | 4 +-- tests/Test-E-k-K.px | 4 +-- tests/Test-E-k.px | 4 +-- tests/Test-HTTP-Content-Disposition-1.px | 4 +-- tests/Test-HTTP-Content-Disposition-2.px | 4 +-- tests/Test-HTTP-Content-Disposition.px | 4 +-- tests/Test-N-current.px | 4 +-- tests/Test-N-old.px | 4 +-- tests/Test-N.px | 4 +-- tests/Test-O-nonexisting.px | 4 +-- tests/Test-O.px | 4 +-- tests/Test-Restrict-Lowercase.px | 4 +-- tests/Test-Restrict-Uppercase.px | 4 +-- tests/Test-c-full.px | 4 +-- tests/Test-c-partial.px | 4 +-- tests/Test-c.px | 4 +-- tests/Test-ftp.px | 4 +-- tests/Test-nonexisting-quiet.px | 4 +-- tests/Test-noop.px | 4 +-- tests/Test-np.px | 4 +-- tests/{Test.pm => WgetTest.pm.in} | 10 +++++-- 28 files changed, 92 insertions(+), 56 deletions(-) mode change 100644 => 100755 tests/Test--spider-fail.px mode change 100644 => 100755 tests/Test--spider-r.px mode change 100644 => 100755 tests/Test--spider.px mode change 100644 => 100755 tests/Test-E-k-K.px mode change 100644 => 100755 tests/Test-E-k.px mode change 100644 => 100755 tests/Test-HTTP-Content-Disposition-1.px mode change 100644 => 100755 tests/Test-HTTP-Content-Disposition-2.px mode change 100644 => 100755 tests/Test-HTTP-Content-Disposition.px mode change 100644 => 100755 tests/Test-N-current.px mode change 100644 => 100755 tests/Test-N-old.px mode change 100644 => 100755 tests/Test-N.px mode change 100644 => 100755 tests/Test-O-nonexisting.px mode change 100644 => 100755 tests/Test-O.px mode change 100644 => 100755 tests/Test-Restrict-Lowercase.px mode change 100644 => 100755 tests/Test-Restrict-Uppercase.px mode change 100644 => 100755 tests/Test-c-full.px mode change 100644 => 100755 tests/Test-c-partial.px mode change 100644 => 100755 tests/Test-c.px mode change 100644 => 100755 tests/Test-ftp.px mode change 100644 => 100755 tests/Test-nonexisting-quiet.px mode change 100644 => 100755 tests/Test-noop.px mode change 100644 => 100755 tests/Test-np.px rename tests/{Test.pm => WgetTest.pm.in} (95%) diff --git a/Makefile.in b/Makefile.in index 8d7f9de8..b76228c0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -86,7 +86,7 @@ SUBDIRS = src doc po tests util windows # default target all: src/config.h Makefile $(SUBDIRS) -unittest: src/config.h Makefile +test: src/config.h Makefile cd tests && $(MAKE) $(MAKEDEFS) $@ check: all diff --git a/configure.in b/configure.in index c502a7e4..ae07c6aa 100644 --- a/configure.in +++ b/configure.in @@ -476,7 +476,8 @@ dnl dnl Create output dnl AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile util/Makefile - po/Makefile.in tests/Makefile windows/Makefile]) + po/Makefile.in tests/Makefile tests/WgetTest.pm + windows/Makefile]) AC_CONFIG_HEADERS([src/config.h]) AH_BOTTOM([ #include "config-post.h" diff --git a/tests/FTPTest.pm b/tests/FTPTest.pm index 01c738d4..0e9e0715 100644 --- a/tests/FTPTest.pm +++ b/tests/FTPTest.pm @@ -5,9 +5,9 @@ package FTPTest; use strict; use FTPServer; -use Test; +use WgetTest; -our @ISA = qw(Test); +our @ISA = qw(WgetTest); my $VERSION = 0.01; diff --git a/tests/HTTPTest.pm b/tests/HTTPTest.pm index 885850d0..cd4fb2e2 100644 --- a/tests/HTTPTest.pm +++ b/tests/HTTPTest.pm @@ -5,9 +5,9 @@ package HTTPTest; use strict; use HTTPServer; -use Test; +use WgetTest; -our @ISA = qw(Test); +our @ISA = qw(WgetTest); my $VERSION = 0.01; diff --git a/tests/Makefile.in b/tests/Makefile.in index 49548a5d..b0386640 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -74,7 +74,38 @@ GETOPT_OBJ = @GETOPT_OBJ@ all: -unittest: test$(exeext) +.PHONY: test + +test: run-unit-tests run-px-tests + +run-unit-tests: unit-tests$(exeext) + ./unit-tests$(exeext) + +run-px-tests: WgetTest.pm + ./Test-c-full.px && echo && echo + ./Test-c-partial.px && echo && echo + ./Test-c.px && echo && echo +# ./Test-E-k-K.px && echo && echo +# ./Test-E-k.px && echo && echo + ./Test-ftp.px && echo && echo +# ./Test-HTTP-Content-Disposition.px && echo && echo +# ./Test-HTTP-Content-Disposition-1.px && echo && echo +# ./Test-HTTP-Content-Disposition-2.px && echo && echo + ./Test-N-current.px && echo && echo +# ./Test-nonexisting-quiet.px && echo && echo +# ./Test-noop.px && echo && echo +# ./Test-np.px && echo && echo +# ./Test-N.px && echo && echo + ./Test-O-nonexisting.px && echo && echo + ./Test-O.px && echo && echo +# ./Test-Restrict-Lowercase.px && echo && echo +# ./Test-Restrict-Uppercase.px && echo && echo + ./Test--spider-fail.px && echo && echo + ./Test--spider.px && echo && echo + ./Test--spider-r.px && echo && echo + +WgetTest.pm: WgetTest.pm.in @top_srcdir@/config.status + cd @top_srcdir@ && ./config.status # # Dependencies for test binary @@ -227,7 +258,7 @@ xmalloc.o: ../src/xmalloc.c $(HEADERS) $(COMPILE) -DTESTING -c $< -test$(exeext): $(TESTOBJ) +unit-tests$(exeext): $(TESTOBJ) $(LINK) $(TESTOBJ) $(LIBS) # @@ -235,7 +266,7 @@ test$(exeext): $(TESTOBJ) # clean: - $(RM) *.o test$(exeext) *~ *.bak core core.[0-9]* + $(RM) *.o unit-tests$(exeext) *~ *.bak core core.[0-9]* distclean: clean $(RM) Makefile diff --git a/tests/Test--spider-fail.px b/tests/Test--spider-fail.px old mode 100644 new mode 100755 index 9682681b..c5a299d1 --- a/tests/Test--spider-fail.px +++ b/tests/Test--spider-fail.px @@ -32,7 +32,7 @@ my %urls = ( }, ); -my $cmdline = "wget --spider http://localhost:8080/nonexistent"; +my $cmdline = $WgetTest::WGETPATH . " --spider http://localhost:8080/nonexistent"; my $expected_error_code = 256; @@ -46,7 +46,7 @@ my $the_test = HTTPTest->new (name => "Test--spider-fail", cmdline => $cmdline, errcode => $expected_error_code, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test--spider-r.px b/tests/Test--spider-r.px old mode 100644 new mode 100755 index 94ca2c7a..7b8d460f --- a/tests/Test--spider-r.px +++ b/tests/Test--spider-r.px @@ -89,7 +89,7 @@ my %urls = ( }, ); -my $cmdline = "wget --spider -r http://localhost:8080/"; +my $cmdline = $WgetTest::WGETPATH . " --spider -r http://localhost:8080/"; my $expected_error_code = 0; @@ -103,7 +103,7 @@ my $the_test = HTTPTest->new (name => "Test--spider-r", cmdline => $cmdline, errcode => $expected_error_code, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test--spider.px b/tests/Test--spider.px old mode 100644 new mode 100755 index 2c58cebd..c2c1263e --- a/tests/Test--spider.px +++ b/tests/Test--spider.px @@ -32,7 +32,7 @@ my %urls = ( }, ); -my $cmdline = "wget --spider http://localhost:8080/index.html"; +my $cmdline = $WgetTest::WGETPATH . " --spider http://localhost:8080/index.html"; my $expected_error_code = 256; @@ -46,7 +46,7 @@ my $the_test = HTTPTest->new (name => "Test--spider", cmdline => $cmdline, errcode => $expected_error_code, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test-E-k-K.px b/tests/Test-E-k-K.px old mode 100644 new mode 100755 index 854d47ad..71d51ea1 --- a/tests/Test-E-k-K.px +++ b/tests/Test-E-k-K.px @@ -60,7 +60,7 @@ my %urls = ( }, ); -my $cmdline = "wget -d -r -nd -E -k -K http://localhost:8080/index.php"; +my $cmdline = $WgetTest::WGETPATH . " -d -r -nd -E -k -K http://localhost:8080/index.php"; my $expected_error_code = 0; @@ -83,7 +83,7 @@ my $the_test = HTTPTest->new (name => "Test-E-k-K", cmdline => $cmdline, errcode => $expected_error_code, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test-E-k.px b/tests/Test-E-k.px old mode 100644 new mode 100755 index 86e2dcf6..3bf441df --- a/tests/Test-E-k.px +++ b/tests/Test-E-k.px @@ -60,7 +60,7 @@ my %urls = ( }, ); -my $cmdline = "wget -r -nd -E -k http://localhost:8080/index.php"; +my $cmdline = $WgetTest::WGETPATH . " -r -nd -E -k http://localhost:8080/index.php"; my $expected_error_code = 0; @@ -80,7 +80,7 @@ my $the_test = HTTPTest->new (name => "Test-E-k", cmdline => $cmdline, errcode => $expected_error_code, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test-HTTP-Content-Disposition-1.px b/tests/Test-HTTP-Content-Disposition-1.px old mode 100644 new mode 100755 index da27e3e1..6d295230 --- a/tests/Test-HTTP-Content-Disposition-1.px +++ b/tests/Test-HTTP-Content-Disposition-1.px @@ -37,7 +37,7 @@ my %urls = ( }, ); -my $cmdline = "wget http://localhost:8080/dummy.html"; +my $cmdline = $WgetTest::WGETPATH . " http://localhost:8080/dummy.html"; my $expected_error_code = 0; @@ -70,7 +70,7 @@ my $the_test = HTTPTest->new (name => "Test-HTTP-Content-Disposition-1", errcode => $expected_error_code, existing => \%existing_files, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test-HTTP-Content-Disposition-2.px b/tests/Test-HTTP-Content-Disposition-2.px old mode 100644 new mode 100755 index 589329f5..03eb2bee --- a/tests/Test-HTTP-Content-Disposition-2.px +++ b/tests/Test-HTTP-Content-Disposition-2.px @@ -37,7 +37,7 @@ my %urls = ( }, ); -my $cmdline = "wget --no-content-disposition http://localhost:8080/dummy.html"; +my $cmdline = $WgetTest::WGETPATH . " --no-content-disposition http://localhost:8080/dummy.html"; my $expected_error_code = 0; @@ -70,7 +70,7 @@ my $the_test = HTTPTest->new (name => "Test-HTTP-Content-Disposition-2", errcode => $expected_error_code, existing => \%existing_files, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test-HTTP-Content-Disposition.px b/tests/Test-HTTP-Content-Disposition.px old mode 100644 new mode 100755 index 465c43fb..2a8fd398 --- a/tests/Test-HTTP-Content-Disposition.px +++ b/tests/Test-HTTP-Content-Disposition.px @@ -33,7 +33,7 @@ my %urls = ( }, ); -my $cmdline = "wget http://localhost:8080/dummy.html"; +my $cmdline = $WgetTest::WGETPATH . " http://localhost:8080/dummy.html"; my $expected_error_code = 0; @@ -50,7 +50,7 @@ my $the_test = HTTPTest->new (name => "Test-HTTP-Content-Disposition", cmdline => $cmdline, errcode => $expected_error_code, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test-N-current.px b/tests/Test-N-current.px old mode 100644 new mode 100755 index 9343d179..bb5b0d92 --- a/tests/Test-N-current.px +++ b/tests/Test-N-current.px @@ -27,7 +27,7 @@ my %urls = ( }, ); -my $cmdline = "wget -c http://localhost:8080/somefile.txt"; +my $cmdline = $WgetTest::WGETPATH . " -c http://localhost:8080/somefile.txt"; my $expected_error_code = 0; @@ -51,7 +51,7 @@ my $the_test = HTTPTest->new (name => "Test-N-current", errcode => $expected_error_code, existing => \%existing_files, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test-N-old.px b/tests/Test-N-old.px old mode 100644 new mode 100755 index 7cdc3a0b..05383dbe --- a/tests/Test-N-old.px +++ b/tests/Test-N-old.px @@ -33,7 +33,7 @@ my %urls = ( }, ); -my $cmdline = "wget -N http://localhost:8080/somefile.txt"; +my $cmdline = $WgetTest::WGETPATH . " -N http://localhost:8080/somefile.txt"; my $expected_error_code = 0; @@ -59,7 +59,7 @@ my $the_test = HTTPTest->new (name => "Test-N-old", errcode => $expected_error_code, existing => \%existing_files, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test-N.px b/tests/Test-N.px old mode 100644 new mode 100755 index d70171db..61069875 --- a/tests/Test-N.px +++ b/tests/Test-N.px @@ -24,7 +24,7 @@ my %urls = ( }, ); -my $cmdline = "wget -N http://localhost:8080/dummy.txt"; +my $cmdline = $WgetTest::WGETPATH . " -N http://localhost:8080/dummy.txt"; my $expected_error_code = 0; @@ -42,7 +42,7 @@ my $the_test = HTTPTest->new (name => "Test-N", cmdline => $cmdline, errcode => $expected_error_code, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test-O-nonexisting.px b/tests/Test-O-nonexisting.px old mode 100644 new mode 100755 index b341b7f1..347dc38e --- a/tests/Test-O-nonexisting.px +++ b/tests/Test-O-nonexisting.px @@ -23,7 +23,7 @@ my %urls = ( }, ); -my $cmdline = "wget --quiet -O out http://localhost:8080/nonexistent"; +my $cmdline = $WgetTest::WGETPATH . " --quiet -O out http://localhost:8080/nonexistent"; my $expected_error_code = 256; @@ -40,7 +40,7 @@ my $the_test = HTTPTest->new (name => "Test-O-nonexisting", cmdline => $cmdline, errcode => $expected_error_code, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test-O.px b/tests/Test-O.px old mode 100644 new mode 100755 index 722ff39c..e584d060 --- a/tests/Test-O.px +++ b/tests/Test-O.px @@ -23,7 +23,7 @@ my %urls = ( }, ); -my $cmdline = "wget -O out http://localhost:8080/dummy.txt"; +my $cmdline = $WgetTest::WGETPATH . " -O out http://localhost:8080/dummy.txt"; my $expected_error_code = 0; @@ -40,7 +40,7 @@ my $the_test = HTTPTest->new (name => "Test-O", cmdline => $cmdline, errcode => $expected_error_code, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test-Restrict-Lowercase.px b/tests/Test-Restrict-Lowercase.px old mode 100644 new mode 100755 index 035b47a8..fab08d43 --- a/tests/Test-Restrict-Lowercase.px +++ b/tests/Test-Restrict-Lowercase.px @@ -32,7 +32,7 @@ my %urls = ( }, ); -my $cmdline = "wget --restrict-file-names=lowercase http://localhost:8080/SomePage.html"; +my $cmdline = $WgetTest::WGETPATH . " --restrict-file-names=lowercase http://localhost:8080/SomePage.html"; my $expected_error_code = 0; @@ -49,7 +49,7 @@ my $the_test = HTTPTest->new (name => "Test-Restrict-Lowercase", cmdline => $cmdline, errcode => $expected_error_code, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test-Restrict-Uppercase.px b/tests/Test-Restrict-Uppercase.px old mode 100644 new mode 100755 index 05e5bcde..cefa1722 --- a/tests/Test-Restrict-Uppercase.px +++ b/tests/Test-Restrict-Uppercase.px @@ -32,7 +32,7 @@ my %urls = ( }, ); -my $cmdline = "wget --restrict-file-names=uppercase http://localhost:8080/SomePage.html"; +my $cmdline = $WgetTest::WGETPATH . " --restrict-file-names=uppercase http://localhost:8080/SomePage.html"; my $expected_error_code = 0; @@ -49,7 +49,7 @@ my $the_test = HTTPTest->new (name => "Test-Restrict-Uppercase", cmdline => $cmdline, errcode => $expected_error_code, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test-c-full.px b/tests/Test-c-full.px old mode 100644 new mode 100755 index c57182ef..bb9304b9 --- a/tests/Test-c-full.px +++ b/tests/Test-c-full.px @@ -27,7 +27,7 @@ my %urls = ( }, ); -my $cmdline = "wget -c http://localhost:8080/somefile.txt"; +my $cmdline = $WgetTest::WGETPATH . " -c http://localhost:8080/somefile.txt"; my $expected_error_code = 0; @@ -51,7 +51,7 @@ my $the_test = HTTPTest->new (name => "Test-c-full", errcode => $expected_error_code, existing => \%existing_files, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test-c-partial.px b/tests/Test-c-partial.px old mode 100644 new mode 100755 index 8661cfa6..ee48cbf6 --- a/tests/Test-c-partial.px +++ b/tests/Test-c-partial.px @@ -32,7 +32,7 @@ my %urls = ( }, ); -my $cmdline = "wget -c http://localhost:8080/somefile.txt"; +my $cmdline = $WgetTest::WGETPATH . " -c http://localhost:8080/somefile.txt"; my $expected_error_code = 0; @@ -56,7 +56,7 @@ my $the_test = HTTPTest->new (name => "Test-c-partial", errcode => $expected_error_code, existing => \%existing_files, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test-c.px b/tests/Test-c.px old mode 100644 new mode 100755 index 4306cab6..58b45f72 --- a/tests/Test-c.px +++ b/tests/Test-c.px @@ -27,7 +27,7 @@ my %urls = ( }, ); -my $cmdline = "wget -c http://localhost:8080/somefile.txt"; +my $cmdline = $WgetTest::WGETPATH . " -c http://localhost:8080/somefile.txt"; my $expected_error_code = 0; @@ -48,7 +48,7 @@ my $the_test = HTTPTest->new (name => "Test-c", errcode => $expected_error_code, existing => \%existing_files, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test-ftp.px b/tests/Test-ftp.px old mode 100644 new mode 100755 index c756ac6b..5925e38b --- a/tests/Test-ftp.px +++ b/tests/Test-ftp.px @@ -21,7 +21,7 @@ my %urls = ( }, ); -my $cmdline = "wget -S ftp://localhost:8021/afile.txt"; +my $cmdline = $WgetTest::WGETPATH . " -S ftp://localhost:8021/afile.txt"; my $expected_error_code = 0; @@ -38,7 +38,7 @@ my $the_test = FTPTest->new (name => "Test-ftp", cmdline => $cmdline, errcode => $expected_error_code, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test-nonexisting-quiet.px b/tests/Test-nonexisting-quiet.px old mode 100644 new mode 100755 index 97ee275e..45f24390 --- a/tests/Test-nonexisting-quiet.px +++ b/tests/Test-nonexisting-quiet.px @@ -23,7 +23,7 @@ my %urls = ( }, ); -my $cmdline = "wget --quiet http://localhost:8080/nonexistent"; +my $cmdline = $WgetTest::WGETPATH . " --quiet http://localhost:8080/nonexistent"; my $expected_error_code = 256; @@ -37,7 +37,7 @@ my $the_test = HTTPTest->new (name => "Test-nonexisting-quiet", cmdline => $cmdline, errcode => $expected_error_code, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test-noop.px b/tests/Test-noop.px old mode 100644 new mode 100755 index 296e845a..e45c8af3 --- a/tests/Test-noop.px +++ b/tests/Test-noop.px @@ -33,7 +33,7 @@ my %urls = ( }, ); -my $cmdline = "wget http://localhost:8080/"; +my $cmdline = $WgetTest::WGETPATH . " http://localhost:8080/"; my $expected_error_code = 0; @@ -50,7 +50,7 @@ my $the_test = HTTPTest->new (name => "Test-noop", cmdline => $cmdline, errcode => $expected_error_code, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test-np.px b/tests/Test-np.px old mode 100644 new mode 100755 index dcb165fd..8a14b32d --- a/tests/Test-np.px +++ b/tests/Test-np.px @@ -119,7 +119,7 @@ my %urls = ( }, ); -my $cmdline = "wget -np -nH -r http://localhost:8080/firstlevel/"; +my $cmdline = $WgetTest::WGETPATH . " -np -nH -r http://localhost:8080/firstlevel/"; my $expected_error_code = 0; @@ -142,7 +142,7 @@ my $the_test = HTTPTest->new (name => "Test-np", cmdline => $cmdline, errcode => $expected_error_code, output => \%expected_downloaded_files); -$the_test->run(); +exit $the_test->run(); # vim: et ts=4 sw=4 diff --git a/tests/Test.pm b/tests/WgetTest.pm.in similarity index 95% rename from tests/Test.pm rename to tests/WgetTest.pm.in index c5449d59..b20b5d8f 100644 --- a/tests/Test.pm +++ b/tests/WgetTest.pm.in @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -package Test; +package WgetTest; $VERSION = 0.01; use strict; @@ -8,6 +8,8 @@ use strict; use Cwd; use File::Path; +our $WGETPATH = "@top_srcdir@/src/wget"; + my @unexpected_downloads = (); { @@ -39,7 +41,7 @@ sub new { my $caller_is_obj = ref($caller); my $class = $caller_is_obj || $caller; #print STDERR "class = ", $class, "\n"; - #print STDERR "_attr_data {workdir} = ", $Test::_attr_data{_workdir}, "\n"; + #print STDERR "_attr_data {workdir} = ", $WgetTest::_attr_data{_workdir}, "\n"; my $self = bless {}, $class; foreach my $attrname ($self->_standard_keys()) { #print STDERR "attrname = ", $attrname, " value = "; @@ -92,7 +94,8 @@ sub run { unless ($errcode == $self->{_errcode}) { $result_message = "Test failed: wrong code returned (was: $errcode, expected: $self->{_errcode})\n"; } - if (my $error_str = $self->_verify_download()) { + my $error_str; + if ($error_str = $self->_verify_download()) { $result_message = $error_str; } @@ -100,6 +103,7 @@ sub run { $self->_cleanup(); print $result_message; + return $errcode != $self->{_errcode} || ($error_str ? 1 : 0); } -- 2.39.2