Changeset 1151


Ignore:
Timestamp:
Jan 31, 2008, 1:53:58 AM (14 years ago)
Author:
Earle Martin
Message:

Put time on the horizontal axis at perigrin's request.

Location:
status
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • status/report.pl

    r1150 r1151  
    77use Template;
    88
    9 my (%results, %test_names);
     9my (%results_by_date, %results_by_test);
    1010
    1111foreach (glob "reports/*") {
    1212        my ($report_name) = $_ =~ m{reports/test-results-(.*)\.txt};
    1313       
    14         $results{$report_name} = load_report($_);
     14        $results_by_date{$report_name} = load_report($_);
     15}
     16
     17# Turn sorted-by-date structure inside out.
     18foreach my $date (keys %results_by_date) {
     19                my $date_result = $results_by_date{$date};
     20                foreach my $test_name (keys %$date_result) {
     21                        $results_by_test{$test_name}{$date} = $date_result->{$test_name};
     22                }
    1523}
    1624
    1725my %report_data = (
    18         'results'    => \%results,
    19         'test_names' => [ sort keys %test_names ],
     26        'results'    => \%results_by_test,
     27        'test_dates' => [ sort keys %results_by_date ],
    2028);
    2129
     
    5058                        if (m{^t/(.*?)\.}) {
    5159                                $current_test = $1;
    52                                 $test_names{$current_test} = 1;
    5360                        } elsif (/^ok$/) {
    5461                                $tests{$current_test} = 100;
  • status/templates/tests.tt

    r1150 r1151  
    2222        <tr>
    2323                <td></td>
    24 [% FOREACH test_name IN data.test_names %]
    25                 <th>[% test_name.replace('_', ' ') %]</th>
     24[% FOREACH test_date IN data.test_dates %]
     25                <th>[% test_date %]</th>
    2626[%- END %]
    2727        </tr>
    28 [% FOREACH test_date IN data.results.keys %]
    29 [% day_results = data.results.$test_date %]
     28[% FOREACH test_name IN data.results.keys.sort %]
     29[% test_results = data.results.$test_name %]
    3030        <tr>
    31                 <td>[% test_date %]</td>
    32         [% FOREACH datum IN day_results.keys.sort %]
    33                 <td>[% day_results.$datum %]%</td>
     31                <td>[% test_name.replace('_', ' ') %]</td>
     32        [% FOREACH datum IN test_results.keys.sort %]
     33                <td>[% test_results.$datum %]%</td>
    3434        [% END %]
    3535        </tr>
Note: See TracChangeset for help on using the changeset viewer.