[Swift-commit] r5133 - wwwdev/tests

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Mon Sep 19 21:05:31 CDT 2011


Author: davidk
Date: 2011-09-19 21:05:31 -0500 (Mon, 19 Sep 2011)
New Revision: 5133

Modified:
   wwwdev/tests/tests.pl
Log:
Update tests.pl to better organize test results


Modified: wwwdev/tests/tests.pl
===================================================================
--- wwwdev/tests/tests.pl	2011-09-19 22:21:45 UTC (rev 5132)
+++ wwwdev/tests/tests.pl	2011-09-20 02:05:31 UTC (rev 5133)
@@ -1,4 +1,7 @@
-#!/usr/bin/perl
+#!/usr/bin/perl 
+use strict;
+use lib '/home/davidk/modules/';
+use Lingua::EN::Numbers::Ordinate;
 
 print <<'END';
 Content-type: text/html
@@ -11,18 +14,30 @@
 <body>
 END
 
-my @versions = <*/>;
-foreach my $version(@versions) {
-   $version =~ s/\///;
-   print "<h1>$version</h1>\n<ul>\n";
-   my @results = <$version/*/*.html>;
-   foreach my $result(@results) {
-      my @parts = split("/", $result);
-      my $link_name = $parts[scalar @parts - 2];  
-      $link_name =~ s/run-//;
-      print "<li><a href=\"$result\">$link_name</a></li>\n";
+my @table_data=();
+my $count=1;
+my @months = ("Zero", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
+
+foreach my $swift_version(<*/>) {
+   $swift_version =~ s/\///;
+   $table_data[0] .= "<th>$swift_version</th>";
+    
+   my $previous_month=0;
+
+   foreach my $test_result(<$swift_version/*/*.html>) {
+      (my $ignore, my $year, my $month, my $day) = (split('-', (split('/', $test_result))[1]));
+      $day =~ s/^0*//;
+      $table_data[$count] .= "<td><a href=\"$test_result\">$months[$month] " . ordinate($day) . ", $year</a></td>";
+      $count++;
    }
-   print "</ul>\n";
+ 
+   $count=1;
 }
 
-print "</body></html>\n";
+# Print table
+print "<center><table border=\"1\" width=\"600\">\n";
+print "<tr>$table_data[0]</tr>\n";
+foreach my $td(@table_data[1..$#table_data]) {
+   print "<tr>$td</tr>\n";
+}
+print "</table></center></body></html>\n";




More information about the Swift-commit mailing list