]> sjero.net Git - wget/commitdiff
[svn] Minor fixes/updates for the testing suite.
authormtortonesi <devnull@localhost>
Wed, 22 Aug 2007 14:05:18 +0000 (07:05 -0700)
committermtortonesi <devnull@localhost>
Wed, 22 Aug 2007 14:05:18 +0000 (07:05 -0700)
tests/ChangeLog
tests/Makefile.in
tests/Test-HTTP-Content-Disposition-1.px
tests/Test-HTTP-Content-Disposition.px
tests/Test-N-current.px
tests/WgetTest.pm.in

index 085f45be345bc36aad3036c9adbbe2fd6d9efea4..c5b42778efbeedef1afed51c24422c3bdf08dbea 100644 (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
index ad2444347c8999537ccf10bc02d427d54b2b8eac..21d7641064a314ab87acadac83e838d8d05c5b94 100644 (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
index 6d2952308b4ed5ded9c085e250ae930049710cdf..ffc9eb25af43643c7fc75beeb5e39c906d449c84 100755 (executable)
@@ -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;
 
index 2a8fd398507a54343d160d15359d10adcf5af6f8..0f4b285b6190ec4a3779226d9250bfd36a3e81d5 100755 (executable)
@@ -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;
 
index bb5b0d922a5bb36dc14b49da917bbc70e5eb9705..47003c7ee2cd085ff3f3310391339aa1359c3f58 100755 (executable)
@@ -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"
     },
 );
 
index b20b5d8fb752fef11381695b369a3bd13866bcfa..a57c1bb8c46b2c52059a0ac48de2239ca2b4200c 100644 (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");