Skip to content

Commit 15222c2

Browse files
author
Geoffrey Broadwell
committed
Make compare and show-failures independent
1 parent 758386d commit 15222c2

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

analyze

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -462,44 +462,44 @@ sub summarize_results_text {
462462
}
463463
$output .= "\n";
464464

465-
next unless $opt->{compare};
466-
467-
$output .= sprintf "%-${longest_test}s", '';
468-
for my $comp (@comps) {
469-
my $key = $comp->{key} || $comp->{name};
470-
my $peak = $test->{compare}{peak_rate}{$key};
471-
my $rel = $peak->{relative_to_max};
472-
if ($rel) {
473-
$rel = 1 / $rel;
474-
my $color = $rel < 2 ? $GREEN :
475-
$rel < 10 ? $YELLOW :
476-
$RED ;
477-
$output .= sprintf "$spacer$color%${longest_comp}.1fx $CLEAR", $rel;
478-
}
479-
else {
480-
# XXXX: May have to make this based on key instead of name
481-
my $conf = $test->{conf};
482-
my $is_skip = !defined $conf->{$comp->{group}}
483-
|| (grep { $_ eq $comp->{name} } @{$conf->{skip} || []})
484-
|| (exists $conf->{skip} && !defined $conf->{skip});
485-
$output .= sprintf "$spacer$RED%${longest_comp}s $CLEAR",
486-
$is_skip ? 'SKIP' : 'FAIL';
465+
if ($opt->{compare}) {
466+
$output .= sprintf "%-${longest_test}s", '';
467+
for my $comp (@comps) {
468+
my $key = $comp->{key} || $comp->{name};
469+
my $peak = $test->{compare}{peak_rate}{$key};
470+
my $rel = $peak->{relative_to_max};
471+
if ($rel) {
472+
$rel = 1 / $rel;
473+
my $color = $rel < 2 ? $GREEN :
474+
$rel < 10 ? $YELLOW :
475+
$RED ;
476+
$output .= sprintf "$spacer$color%${longest_comp}.1fx $CLEAR", $rel;
477+
}
478+
else {
479+
# XXXX: May have to make this based on key instead of name
480+
my $conf = $test->{conf};
481+
my $is_skip = !defined $conf->{$comp->{group}}
482+
|| (grep { $_ eq $comp->{name} } @{$conf->{skip} || []})
483+
|| (exists $conf->{skip} && !defined $conf->{skip});
484+
$output .= sprintf "$spacer$RED%${longest_comp}s $CLEAR",
485+
$is_skip ? 'SKIP' : 'FAIL';
486+
}
487487
}
488+
$output .= "\n";
488489
}
489-
$output .= "\n";
490490

491-
next unless $opt->{'show-failures'};
492-
493-
$output .= sprintf "%-${longest_test}s", '';
494-
my $len = $longest_comp + 2;
495-
for my $comp (@comps) {
496-
my $key = $comp->{key} || $comp->{name};
497-
my $diag = $test->{diagnoses}{$key}{sorted};
498-
my @icons = map { $DIAGNOSIS_ICON{$_}
499-
// $DIAGNOSIS_ICON{unknown} } @$diag;
500-
$output .= sprintf "$spacer%${len}s", join '' => @icons;
491+
if ($opt->{'show-failures'}) {
492+
$output .= sprintf "%-${longest_test}s", '';
493+
my $len = $longest_comp + 2;
494+
for my $comp (@comps) {
495+
my $key = $comp->{key} || $comp->{name};
496+
my $diag = $test->{diagnoses}{$key}{sorted};
497+
my @icons = map { $DIAGNOSIS_ICON{$_}
498+
// $DIAGNOSIS_ICON{unknown} } @$diag;
499+
$output .= sprintf "$spacer%${len}s", join '' => @icons;
500+
}
501+
$output .= "\n";
501502
}
502-
$output .= "\n";
503503
}
504504

505505
my $scores = $data->{score};

0 commit comments

Comments
 (0)