]> err.no Git - varnish/commitdiff
Improve the report further.
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 15 Jun 2007 11:23:13 +0000 (11:23 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 15 Jun 2007 11:23:13 +0000 (11:23 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1527 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-tools/regress/lib/Varnish/Test/Report.pm
varnish-tools/regress/lib/Varnish/Test/Report/report.html

index 679951c9b36b42708917cb7c90b9ffed75a019fe..7770bfdfae42d8b3636f2d0a5637c7f6f9a90afd 100644 (file)
@@ -57,7 +57,20 @@ sub run($@) {
     die "No template defined\n"
        unless defined($self->{'template'});
     my $template = new Template($self->{'config'});
-    $template->process($self->{'template'}, { 'cases' => \@cases })
+    my ($count, $pass, $fail, $time);
+    map {
+       $count += $_->{'count'};
+       $pass += $_->{'pass'};
+       $fail += $_->{'fail'};
+       $time += $_->{'time'};
+    } @cases;
+    $template->process($self->{'template'}, {
+       'cases' => \@cases,
+       'count' => $count,
+       'pass' => $pass,
+       'fail' => $fail,
+       'time' => $time,
+    })
        or die $template->error();
 }
 
index 6fbcdf8a6d29dabbf9e112eb39119d54be696a16..4549f303c13cd7015c2e40b97e7bc1a8312e2b93 100644 (file)
@@ -6,38 +6,57 @@
     <title>Varnish test report</title>
     <meta name="svnid" content="$Id$"/>
     <style type="text/css">
-      table { border-collapse: collapse; border: none; }
-      td, th { border: thin solid black; padding: 3pt; }
-      th { background-color: #eeeeff; }
-      tr.pass { background-color: #eeffee; }
-      tr.fail { background-color: #ffeeee; }
+table { border-collapse: collapse; border: none; }
+td, th { border: thin solid black; padding: 3pt; text-align: left; }
+thead, tfoot { background-color: #eeeeff; }
+tr.pass { background-color: #eeffee; }
+tr.fail { background-color: #ffeeee; }
+.name { width: 15%; }
+.count { width: 5%; }
+.pass { width: 5%; }
+.fail { width: 5%; }
+.time { width: 10%; }
+.descr { width: 60%; }
     </style>
   </head>
+<!-- USE us = format('%8.6f') -->
   <body>
     <h1 class="title">Varnish test report</h1>
     <table>
-      <tr>
-       <th>Name</th>
-       <th>Time</th>
-       <th>Tests</th>
-       <th>Passed</th>
-       <th>Failed</th>
-       <th>Description</th>
-      </tr>
+      <thead>
+       <tr>
+         <th class="name">Name</th>
+         <th class="tests">Tests</th>
+         <th class="pass">Pass</th>
+         <th class="fail">Fail</th>
+         <th class="time">Time</th>
+         <th class="descr">Description</th>
+       </tr>
+      </thead>
 <!-- FOREACH case = cases -->
 <!-- IF case.pass == case.count -->
       <tr class="pass">
 <!-- ELSE -->
       <tr class="fail">
 <!-- END -->
-       <td><!-- case.name --></td>
-       <td><!-- case.time --></td>
-       <td><!-- case.count --></td>
-       <td><!-- case.pass --></td>
-       <td><!-- case.fail --></td>
-       <td><!-- case.descr --></td>
+       <td class="name"><!-- case.name --></td>
+       <td class="count"><!-- case.count --></td>
+       <td class="pass"><!-- case.pass --></td>
+       <td class="fail"><!-- case.fail --></td>
+       <td class="time"><!-- us(case.time) --> s</td>
+       <td class="descr"><!-- case.descr --></td>
       </tr>
 <!-- END -->
+      <tfoot>
+       <tr>
+         <th class="name">Total</th>
+         <td class="count"><!-- count --></td>
+         <td class="pass"><!-- pass --></td>
+         <td class="fail"><!-- fail --></td>
+         <td class="time"><!-- us(time) --> s</td>
+         <td class="descr">&nbsp;</td>
+       </tr>
+      </tfoot>
     </table>
   </body>
 </html>