]> sjero.net Git - wget/commitdiff
[svn] Minor bugfixing for test suite.
authormtortonesi <devnull@localhost>
Fri, 26 May 2006 12:55:34 +0000 (05:55 -0700)
committermtortonesi <devnull@localhost>
Fri, 26 May 2006 12:55:34 +0000 (05:55 -0700)
tests/ChangeLog
tests/HTTPServer.pm
tests/Test.pm

index a5146abab4724390881301122b80df025d42d003..ac4109a57f19a7f2fe22d94b1098a18d67e61bc7 100644 (file)
@@ -1,3 +1,10 @@
+2006-05-26  Mauro Tortonesi  <mauro@ferrara.linux.it>
+
+       * HTTPServer.pm: Fixed bug when returning 404. Improved logging. 
+
+       * Test.pm: Added support for command lines which use an absolute path
+       for the Wget binary.
+
 2006-04-28  Mauro Tortonesi  <mauro@ferrara.linux.it>
 
        * Test5.px: Added test for HTTP Content-Disposition support.
index c66ef85307fa6249b2add5083b9cc54a80da9b14..6747359ec648cde68f435f1946194a4bb0b434af 100755 (executable)
@@ -19,6 +19,7 @@ sub run {
     my ($self, $urls) = @_;
                                 
     while (my $con = $self->accept) {
+        print STDERR "Accepted a new connection\n" if $log;
         while (my $req = $con->get_request) {
             my $url_path = $req->url->path;
             if ($url_path =~ m{/$}) {
@@ -71,8 +72,10 @@ sub run {
             } else {
                 print STDERR "Requested wrong URL: ", $url_path, "\n" if $log;
                 $con->send_error($HTTP::Status::RC_FORBIDDEN);
-            }
+                last;
+            }            
         }
+        print STDERR "Closing connection\n" if $log;
         $con->close;
         undef($con);
     }
index d25ee4ff6e83940c2b6e56c47a7607d18d503561..d996e77d7612bea3f6675a4b29e128dc77df10a1 100755 (executable)
@@ -81,7 +81,10 @@ sub run {
     # Call wget
     chdir ("$self->{_workdir}/$self->{_name}/output");
     # print "Calling $self->{_cmdline}\n";
-    my $errcode = system ("$self->{_workdir}/../src/$self->{_cmdline}");
+    my $errcode = 
+        ($self->{_cmdline} =~ m{^/.*}) 
+            ? system ($self->{_cmdline})
+            : system ("$self->{_workdir}/../src/$self->{_cmdline}");
 
     # Shutdown server
     kill ('TERM', $pid);