[cairo-commit] cairo/test make-html.pl,1.1,1.2

Vladimir Vukicevic commit at pdx.freedesktop.org
Tue Jan 3 07:30:02 PST 2006


Committed by: vladimir

Update of /cvs/cairo/cairo/test
In directory gabe:/tmp/cvs-serv528/test

Modified Files:
	make-html.pl 
Log Message:
* test/make-html.pl: Clean up output some; show only images that
  fail, otherwise just show pass/fail squares.



Index: make-html.pl
===================================================================
RCS file: /cvs/cairo/cairo/test/make-html.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- make-html.pl	12 Dec 2005 19:56:40 -0000	1.1
+++ make-html.pl	3 Jan 2006 15:29:58 -0000	1.2
@@ -29,6 +29,19 @@
 ## html to stdout that can be used to view all the test results at once.
 ##
 
+# some config options:
+
+# show reference images
+my $config_show_ref = 0;
+
+# show fail images
+my $config_show_fail = 1;
+
+# show all results, even passes
+my $config_show_all = 0;
+
+# end of config options
+
 my $tests = {};
 
 my $teststats = {};
@@ -73,29 +86,38 @@
 printl '<html><head>';
 printl '<title>Cairo Test Results</title>';
 printl '<style type="text/css">';
-printl '.PASS { border: 2px solid #009900; background-color: #999999; }';
+printl 'a img { border: none; }';
+printl '.PASS { background-color: #009900; min-width: 1em; }';
 printl '.FAIL { background-color: #990000; }';
 printl '.XFAIL { background-color: #999900; }';
 printl '.UNTESTED { background-color: #333333; }';
+printl '.PASSstr { color: #009900; }';
+printl '.FAILstr { color: #990000; }';
+printl '.XFAILstr { color: #999900; }';
+printl '.UNTESTEDstr { color: #333333; }';
 printl 'img { max-width: 15em; min-width: 3em; }';
 printl 'td { vertical-align: top; }';
 printl '</style>';
 printl '<body>';
 
 printl '<table border="1">';
-print '<tr><th>Test</th><th>Ref</th>';
+print '<tr><th>Test</th>';
+print '<th>Ref</th>' if $config_show_ref;
+
 foreach my $target (@targets) {
   print '<th>', $target, '</th>';
 }
 printl '</tr>';
 
-print '<tr><td></td><td></td>';
+print '<tr><td></td>';
+print '<td></td>' if $config_show_ref;
+
 foreach my $target (@targets) {
   print '<td>';
-  print 'PASS: ', $teststats->{$target}->{"PASS"}, '<br>';
-  print 'FAIL: ', $teststats->{$target}->{"FAIL"}, '<br>';
-  print 'XFAIL: ', $teststats->{$target}->{"XFAIL"}, '<br>';
-  print 'UNTESTED: ', $teststats->{$target}->{"UNTESTED"};
+  print '<span class="PASSstr">', $teststats->{$target}->{"PASS"}, '</span>/';
+  print '<span class="FAILstr">', $teststats->{$target}->{"FAIL"}, '</span>/';
+  print '<span class="XFAILstr">', $teststats->{$target}->{"XFAIL"}, '</span>/';
+  print '<span class="UNTESTEDstr">', $teststats->{$target}->{"UNTESTED"}; '</span>';
   print '</td>';
 }
 printl '</tr>';
@@ -125,10 +147,9 @@
 
 foreach my $test (sort(keys %$tests)) {
   foreach my $format (@formats) {
-    print '<tr><td>', $test, ' (', $format, ')</td>';
+    my $testline = "";
 
-    my $testref = testref($test, $format);
-    print "<td><img src=\"$testref\"></td>";
+    my $num_failed = 0;
 
     foreach my $target (@targets) {
       my $tgtdata = $tests->{$test}->{$target};
@@ -136,23 +157,47 @@
 	my $testres = $tgtdata->{$format};
 	if ($testres) {
 	  my %testfiles = testfiles($test, $target, $format);
-	  print "<td class=\"$testres\">";
+	  $testline .= "<td class=\"$testres\">";
 	  $stats{$target}{$testres}++;
 	  if ($testres eq "PASS") {
-	    print "<img src=\"", $testfiles{"out"}, "\"></td>";
-	  } elsif ($testres eq "FAIL" || $testres eq "XFAIL") {
-	    print "<img src=\"", $testfiles{"out"}, "\"><br><hr size=\"1\">";
-	    print "<img src=\"", $testfiles{"diff"}, "\">";
+	    if ($config_show_all) {
+	      $testline .= "<a href=\"" . $testfiles{"out"} . "\"><img src=\"" . $testfiles{"out"} . "\"></a>";
+	    }
+	  } elsif ($testres eq "FAIL") {
+	    $num_failed++;
+
+	    if ($config_show_fail || $config_show_all) {
+	      $testline .= "<a href=\"" . $testfiles{"out"} . "\"><img src=\"" . $testfiles{"out"} . "\"></a>";
+	      $testline .= "<hr size=\"1\">";
+	      $testline .= "<a href=\"" . $testfiles{"diff"} . "\"><img src=\"" . $testfiles{"diff"} . "\"></a>";
+	    }
+	  } elsif ($testres eq "XFAIL") {
+	    #nothing
+	    if ($config_show_all) {
+	      $testline .= "<a href=\"" . $testfiles{"out"} . "\"><img src=\"" . $testfiles{"out"} . "\"></a>";
+	      $testline .= "<hr size=\"1\">";
+	      $testline .= "<a href=\"" . $testfiles{"diff"} . "\"><img src=\"" . $testfiles{"diff"} . "\"></a>";
+	    }
 	  }
-	  print "</td>";
+
+	  $testline .= "</td>";
 	} else {
-	  print '<td></td>';
+	  $testline .= '<td></td>';
 	}
       } else {
-	print '<td></td>';
+	$testline .= '<td></td>';
       }
     }
 
+    my $testref = testref($test, $format);
+    print '<tr><td>', "<a href=\"$testref\">", $test, ' (', $format, ')</a></td>';
+
+    if ($config_show_ref) {
+      print "<td><a href=\"$testref\"><img src=\"$testref\"></img></a></td>";
+    }
+
+    print $testline;
+
     print "</tr>\n";
   }
 }



More information about the cairo-commit mailing list