[svn] Minor fixes/updates for the testing suite.

This commit is contained in:
mtortonesi 2007-08-22 07:05:18 -07:00
parent 19f0a05e91
commit ae6b79c855
6 changed files with 47 additions and 22 deletions

View File

@ -1,3 +1,18 @@
2007-08-21 Mauro Tortonesi <mauro@ferrara.linux.it>
* WgetTest.pm.in: Added support for timestamping of pre-existing
files.
* Test-N-current.px: Fixed broken test logic.
* Makefile.in: Updated list of automatically run tests.
* Test-HTTP-Content-Disposition.px: Added -e contentdisposition=on
option, since now HTTP Content-Disposition header support is turned
off by default.
* Test-HTTP-Content-Disposition-1.px: Ditto.
2007-07-25 Micah Cowan <micah@cowan.name>
* HTTPServer.pm (run, send_response): Farmed out some logic from

View File

@ -85,28 +85,29 @@ run-unit-tests: unit-tests$(exeext)
./unit-tests$(exeext)
run-px-tests: WgetTest.pm
./Test-auth-basic.px && echo && echo
./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-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-HTTP-Content-Disposition-1.px && echo && echo
./Test-HTTP-Content-Disposition-2.px && echo && echo
./Test-HTTP-Content-Disposition.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-N-old.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-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
./Test-auth-basic.px && echo && echo
WgetTest.pm: WgetTest.pm.in @top_srcdir@/config.status
cd @top_srcdir@ && ./config.status

View File

@ -37,7 +37,7 @@ my %urls = (
},
);
my $cmdline = $WgetTest::WGETPATH . " http://localhost:8080/dummy.html";
my $cmdline = $WgetTest::WGETPATH . " -e contentdisposition=on http://localhost:8080/dummy.html";
my $expected_error_code = 0;

View File

@ -33,7 +33,7 @@ my %urls = (
},
);
my $cmdline = $WgetTest::WGETPATH . " http://localhost:8080/dummy.html";
my $cmdline = $WgetTest::WGETPATH . " -e contentdisposition=on http://localhost:8080/dummy.html";
my $expected_error_code = 0;

View File

@ -7,7 +7,7 @@ use HTTPTest;
###############################################################################
my $wholefile = <<EOF;
my $currentversion = <<EOF;
11111111111111111111111111111111111111111111111111
222222222222222222222222222222222222222222222222222222222222
3333333333333333333333333333333333333333333333333333333333333333333333
@ -22,24 +22,27 @@ my %urls = (
msg => "Dontcare",
headers => {
"Content-type" => "text/plain",
"Last-Modified" => "Sat, 09 Oct 2004 08:30:00 GMT",
},
content => $wholefile,
content => $currentversion,
},
);
my $cmdline = $WgetTest::WGETPATH . " -c http://localhost:8080/somefile.txt";
my $cmdline = $WgetTest::WGETPATH . " -N http://localhost:8080/somefile.txt";
my $expected_error_code = 0;
my %existing_files = (
'somefile.txt' => {
content => $wholefile,
content => $currentversion,
timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT"
},
);
my %expected_downloaded_files = (
'somefile.txt' => {
content => $wholefile,
content => $currentversion,
timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT"
},
);

View File

@ -124,11 +124,17 @@ sub _setup {
foreach my $filename (keys %{$self->{_existing}}) {
open (FILE, ">$filename")
or return "Test failed: cannot open pre-existing file $filename\n";
print FILE $self->{_existing}->{$filename}->{content}
my $file = $self->{_existing}->{$filename};
print FILE $file->{content}
or return "Test failed: cannot write pre-existing file $filename\n";
close (FILE);
if (exists($file->{timestamp})) {
utime $file->{timestamp}, $file->{timestamp}, $filename
or return "Test failed: cannot set timestamp on pre-existing file $filename\n";
}
}
chdir ("../input");