Author: earle Date: 2008-01-31 01:53:58 +0000 (Thu, 31 Jan 2008) New Revision: 1151
Modified: status/report.pl status/templates/tests.tt Log: Put time on the horizontal axis at perigrin's request.
Modified: status/report.pl =================================================================== --- status/report.pl 2008-01-30 18:16:57 UTC (rev 1150) +++ status/report.pl 2008-01-31 01:53:58 UTC (rev 1151) @@ -6,17 +6,25 @@ use Data::Dumper; use Template;
-my (%results, %test_names); +my (%results_by_date, %results_by_test);
foreach (glob "reports/*") { my ($report_name) = $_ =~ m{reports/test-results-(.*).txt}; - $results{$report_name} = load_report($_); + $results_by_date{$report_name} = load_report($_); }
+# Turn sorted-by-date structure inside out. +foreach my $date (keys %results_by_date) { + my $date_result = $results_by_date{$date}; + foreach my $test_name (keys %$date_result) { + $results_by_test{$test_name}{$date} = $date_result->{$test_name}; + } +} + my %report_data = ( - 'results' => %results, - 'test_names' => [ sort keys %test_names ], + 'results' => %results_by_test, + 'test_dates' => [ sort keys %results_by_date ], );
my $tt = Template->new({ @@ -49,7 +57,6 @@
if (m{^t/(.*?).}) { $current_test = $1; - $test_names{$current_test} = 1; } elsif (/^ok$/) { $tests{$current_test} = 100; } elsif (/Failed .*? tests, (.*?)% okay/) {
Modified: status/templates/tests.tt =================================================================== --- status/templates/tests.tt 2008-01-30 18:16:57 UTC (rev 1150) +++ status/templates/tests.tt 2008-01-31 01:53:58 UTC (rev 1151) @@ -21,16 +21,16 @@ <table border="1"> <tr> <td></td> -[% FOREACH test_name IN data.test_names %] - <th>[% test_name.replace('_', ' ') %]</th> +[% FOREACH test_date IN data.test_dates %] + <th>[% test_date %]</th> [%- END %] </tr> -[% FOREACH test_date IN data.results.keys %] -[% day_results = data.results.$test_date %] +[% FOREACH test_name IN data.results.keys.sort %] +[% test_results = data.results.$test_name %] <tr> - <td>[% test_date %]</td> - [% FOREACH datum IN day_results.keys.sort %] - <td>[% day_results.$datum %]%</td> + <td>[% test_name.replace('_', ' ') %]</td> + [% FOREACH datum IN test_results.keys.sort %] + <td>[% test_results.$datum %]%</td> [% END %] </tr> [%- END %]
openguides-commits@lists.openguides.org