httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1234572 - /httpd/test/framework/trunk/t/modules/cgi.t
Date Sun, 22 Jan 2012 18:45:28 GMT
Author: sf
Date: Sun Jan 22 18:45:28 2012
New Revision: 1234572

URL: http://svn.apache.org/viewvc?rev=1234572&view=rev
Log:
Make sure to have the correct number of tests even if a test fails
Make the verbose output more useful

Modified:
    httpd/test/framework/trunk/t/modules/cgi.t

Modified: httpd/test/framework/trunk/t/modules/cgi.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/cgi.t?rev=1234572&r1=1234571&r2=1234572&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/modules/cgi.t (original)
+++ httpd/test/framework/trunk/t/modules/cgi.t Sun Jan 22 18:45:28 2012
@@ -204,17 +204,23 @@ foreach my $length (@post_content) {
         ## characters logged from the post content
         open (LOG, $cgi_log) or die "died opening cgi log: $!";
         my $multiplier = 256;
-        while (<LOG>) {
-            if (/^$content+$/) {
-                chomp;
-                $multiplier = $length unless $length > $multiplier;
-                print "# verifying that logged content is $multiplier characters\n";
-                ok ($_ eq "$content"x$multiplier);
-                last;
-            }
+        my $log;
+        {
+            local $/;
+            $log = <LOG>;
         }
         close (LOG);
-
+        $multiplier = $length unless $length > $multiplier;
+        print "# verifying that logged content is $multiplier characters\n";
+        if ($log =~ /^(?:$content){$multiplier}\n?$/m) {
+            ok 1;
+        }
+        else {
+            $log =~ s{^}{# }m;
+            print "# no log line found with $multiplier '$content' characters\n";
+            print "# log is:\n'$log'\n";
+            ok 0;
+        }
     } else {
         ## log does not exist ##
         print "# cgi log does not exist, test fails.\n";



Mime
View raw message