#!/usr/bin/perl -w
+# WARNING!
+# WgetTest.pm is a generated file! Do not edit! Edit WgetTest.pm.in
+# instead.
+
package WgetTest;
$VERSION = 0.01;
use Cwd;
use File::Path;
-our $WGETPATH = "@top_srcdir@/src/wget";
+our $WGETPATH = "@abs_top_builddir@/src/wget";
my @unexpected_downloads = ();
# Call wget
chdir ("$self->{_workdir}/$self->{_name}/output");
- # print "Calling $self->{_cmdline}\n";
+ my $cmdline = $self->{_cmdline};
+ $cmdline = $self->_substitute_port($cmdline);
+ print "Calling $cmdline\n";
my $errcode =
- ($self->{_cmdline} =~ m{^/.*})
- ? system ($self->{_cmdline})
- : system ("$self->{_workdir}/../src/$self->{_cmdline}");
+ ($cmdline =~ m{^/.*})
+ ? system ($cmdline)
+ : system ("$self->{_workdir}/../src/$cmdline");
# Shutdown server
# if we didn't explicitely kill the server, we would have to call
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");
or return "Test failed: file $filename not downloaded\n";
my $content = <FILE>;
- $content eq $filedata->{'content'}
+ my $expected_content = $filedata->{'content'};
+ $expected_content = $self->_substitute_port($expected_content);
+ $content eq $expected_content
or return "Test failed: wrong content for file $filename\n";
if (exists($filedata->{'timestamp'})) {