develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r33825 - trunk/languages/perl6/tools

From:
pmichaud
Date:
December 11, 2008 23:42
Subject:
[svn:parrot] r33825 - trunk/languages/perl6/tools
Message ID:
20081212074219.1A324CB9AF@x12.develooper.com
Author: pmichaud
Date: Thu Dec 11 23:42:18 2008
New Revision: 33825

Modified:
   trunk/languages/perl6/tools/progress-graph.pl
   trunk/languages/perl6/tools/test_summary.pl

Log:
[rakudo]:  Updates to test_summary.pl and progress-graph.pl scripts.
* Revise the summary output to be csv compliant (easier spreadsheet import)
* Reorder columns
* Update progress-graph.pl to use new column ordering and labels


Modified: trunk/languages/perl6/tools/progress-graph.pl
==============================================================================
--- trunk/languages/perl6/tools/progress-graph.pl	(original)
+++ trunk/languages/perl6/tools/progress-graph.pl	Thu Dec 11 23:42:18 2008
@@ -37,13 +37,13 @@
 # column names
 use constant DATE       => 0;
 use constant REVISION   => 1;
-use constant FILES      => 2;
-use constant TESTS      => 3;
-use constant PASS       => 4;
-use constant FAIL       => 5;
-use constant TODO       => 6;
-use constant SKIP       => 7;
-use constant SPECPLAN   => 8;
+use constant PASS       => 2;
+use constant FAIL       => 3;
+use constant TODO       => 4;
+use constant SKIP       => 5;
+use constant REGR       => 6;
+use constant SPEC       => 7;
+use constant FILES      => 8;
 use constant SPECSKIP   => 9;
 
 use constant MAX_COL    => 9;
@@ -73,7 +73,7 @@
     $csv->parse($_);
     my @cols = $csv->fields();
     push @{$data[0]}, substr $cols[0], 0, 10;
-    $cols[SPECSKIP] = $cols[SPECPLAN] - sum @cols[PASS, FAIL, TODO, SKIP];
+    $cols[SPECSKIP] = $cols[SPEC] - sum @cols[PASS, FAIL, TODO, SKIP];
     for (1..MAX_COL){
         push @{$data[$_]}, $cols[$_];
     }
@@ -97,7 +97,7 @@
         dclrs               => [qw(#00FF00 #FF0000 #0000FF #FFFF00 #DDDDDD)]
     ) or die $p->error;
 
-$p->set_legend('Pass', 'Fail', 'Todo', 'RSkip', 'SSkip');
+$p->set_legend('Pass', 'Fail', 'Todo', 'Regr', 'Spec');
 $p->set_x_axis_font(gdSmallFont);
 $p->set_y_axis_font(gdSmallFont);
 

Modified: trunk/languages/perl6/tools/test_summary.pl
==============================================================================
--- trunk/languages/perl6/tools/test_summary.pl	(original)
+++ trunk/languages/perl6/tools/test_summary.pl	Thu Dec 11 23:42:18 2008
@@ -47,10 +47,20 @@
     $tname{$tfile} = $tname;
 }
 
-$| = 1;
-printf "%s  plan test pass fail todo skip\n", ' ' x $max;
-my %sum;
+my @syn = qw(S02 S03 S04 S05 S06 S09 S10 S12 S13 S16 S17 S29);
+my @col = qw(pass fail todo skip plan spec);
 my %syn;
+my %sum;
+for my $syn (@syn) {
+    $syn{$syn}++;
+    for my $col (@col) {
+        $sum{"$syn-$col"} = 0;
+    }
+}
+
+$| = 1;
+printf "%s  pass fail todo skip test plan\n", ' ' x $max;
+
 my @fail;
 for my $tfile (@tfiles) {
     my $th;
@@ -62,7 +72,7 @@
     close($th);
     my $tname = $tname{$tfile};
     my $syn = substr($tname, 0, 3); $syn{$syn}++;
-    printf "%s%s..%4d", $tname, '.' x ($max - length($tname)), $plan;
+    printf "%s%s..", $tname, '.' x ($max - length($tname));
     my $cmd = "../../parrot perl6.pbc $tfile";
     my @results = split "\n", `$cmd`;
     my ($test, $pass, $fail, $todo, $skip) = (0,0,0,0,0);
@@ -90,13 +100,14 @@
         push @fail, "$tname aborted $abort test(s)";
         $test += $abort;
     }
-    printf " %4d %4d %4d %4d %4d\n", $test, $pass, $fail, $todo, $skip;
-    $sum{'plan'} += $plan;  $sum{"$syn-plan"} += $plan;
-    $sum{'test'} += $test;  $sum{"$syn-test"} += $test;
+    printf "%4d %4d %4d %4d %4d %4d\n", 
+        $pass, $fail, $todo, $skip, $test, $plan;
     $sum{'pass'} += $pass;  $sum{"$syn-pass"} += $pass;
     $sum{'fail'} += $fail;  $sum{"$syn-fail"} += $fail;
     $sum{'todo'} += $todo;  $sum{"$syn-todo"} += $todo;
     $sum{'skip'} += $skip;  $sum{"$syn-skip"} += $skip;
+    $sum{'test'} += $test;  $sum{"$syn-test"} += $test;
+    $sum{'plan'} += $plan;  $sum{"$syn-plan"} += $plan;
     for (keys %skip) {
         printf "    %2d skipped: %s\n", $skip{$_}, $_;
     }
@@ -108,27 +119,37 @@
     }
 }
 
+for my $syn (sort keys %syn) {
+    my $ackcmd = "ack plan t/spec/$syn* -wh";
+    my @results = `$ackcmd`;
+    my $spec = 0;
+    for (@results) {
+        $spec += $1 if /^\s*plan\s+(\d+)/;
+    }
+    $sum{"$syn-spec"} = $spec;
+    $sum{'spec'} += $spec;
+}
+
+my $sumfmt = qq(%-9.9s %6s,%6s,%6s,%6s,%6s,%6s\n);
 print "----------------\n";
-print "Synopsis summary:\n";
-printf "%s  plan test pass fail todo skip\n", ' ' x $max;
+print qq("Synopsis","pass","fail","todo","skip","regr","spec"\n);
 for my $syn (sort keys %syn) {
-    printf "%s%s..%4d %4d %4d %4d %4d %4d\n",
-        $syn, '.' x ($max - length($syn)),
-        $sum{"$syn-plan"},
-        $sum{"$syn-test"},
-        $sum{"$syn-pass"},
-        $sum{"$syn-fail"},
-        $sum{"$syn-todo"},
-        $sum{"$syn-skip"};
+    printf $sumfmt, qq("$syn",), map { $sum{"$syn-$_"} } @col;
 }
 
+my $total = scalar(@tfiles).' regression files';
+printf $sumfmt, qq("total",), map { $sum{$_} } @col;
+
 print "----------------\n";
+my $rev = $ENV{'REV'};
+if ($rev) {
+    my $file = scalar(@tfiles);
+    print join(',', $rev, (map { $sum{$_} } @col), $file), "\n";
+    print "[rakudo]: spectest-progress.csv update: ",
+          "$file files, $sum{'pass'} passing, $sum{'fail'} failing\n";
+}
+
 if (@fail) {
     print "Failure summary:\n";
     foreach (@fail) { print "    $_\n"; }
 }
-my $total = scalar(@tfiles)." test files";
-$total .= ' ' x ($max-length($total));
-printf "%s  %4d %4d %4d %4d %4d %4d\n",
-    $total, $sum{'plan'}, $sum{'test'}, $sum{'pass'},
-    $sum{'fail'}, $sum{'todo'}, $sum{'skip'};



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About