Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Show failure diagnosis icons in HTML output
  • Loading branch information
Geoffrey Broadwell committed Nov 1, 2014
1 parent 918d15a commit 4ba1f4a
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions analyze
Expand Up @@ -720,10 +720,12 @@ sub summarize_results_html_snippet {
.bench_vm { text-align: center; padding-top: .1em; }
.bench_time_row td { }
.bench_compare_row td { }
.bench_diagnoses_row td { vertical-align: top; }
.bench_spacer_row { height: .7em; }
.bench_rate { text-align: right; font-family: monospace; }
.bench_time { text-align: right; font-family: monospace; }
.bench_no_time { text-align: right; font-family: monospace; }
.bench_diagnoses { text-align: right; font-family: monospace; }
.bench_good { text-align: right; font-family: monospace; background-color: #3f7; color: black; }
.bench_bad { text-align: right; font-family: monospace; background-color: #ee0; color: black; }
.bench_ugly { text-align: right; font-family: monospace; background-color: #f55; color: white; }
Expand Down Expand Up @@ -763,6 +765,12 @@ CSS
$html .= qq{<tr class="$class"><td>$name</td>\n};
};
my $icon_set = sub {
my @icons = map { $DIAGNOSIS_ICON{$_}
// $DIAGNOSIS_ICON{unknown} } @_;
join '' => @icons;
};
my @comps = @{$s->{compilers}};
for my $test (@{$data->{times}}) {
if ($opt->{'show-rates'}) {
Expand Down Expand Up @@ -807,6 +815,33 @@ CSS
$html .= "</tr>\n";
}
if ($opt->{'show-failures'}) {
$show_test_name->($test, 'bench_diagnoses_row');
for my $comp (@comps) {
my $key = $comp->{key} || $comp->{name};
my $diags = $test->{diagnoses}{$key};
my (@icon_sets, $icons);
if ($opt->{verbose}) {
my $by_scale = $diags->{by_scale};
my @scales = sort { $a <=> $b } keys %$by_scale;
my @icon_sets;
for my $scale (@scales) {
my $diag = $by_scale->{$scale};
push @icon_sets, $icon_set->(@$diag);
}
$icons = join '<br>' => @icon_sets;
}
else {
my $diag = $diags->{sorted};
$icons = $icon_set->(@$diag);
}
$html .= qq{ <td class="bench_diagnoses">$icons</td>\n};
}
$html .= "</tr>\n";
}
$html .= qq{<tr class="bench_spacer_row"></tr>\n}
if $double_space;
}
Expand Down

0 comments on commit 4ba1f4a

Please sign in to comment.