Tests: Summarize any skips.

This commit is contained in:
Wilson Snyder 2019-07-30 22:20:37 -04:00
parent 875dc9a27e
commit 68b22a4a3d
2 changed files with 12 additions and 2 deletions

View File

@ -271,6 +271,7 @@ sub new {
fail_cnt => 0,
skip_cnt => 0,
unsup_cnt => 0,
skip_msgs => [],
fail_msgs => [],
fail_tests => [],
@_};
@ -312,6 +313,8 @@ sub one_test {
$self->{ok_cnt}++;
} elsif ($test->scenario_off && !$test->errors) {
} elsif ($test->skips && !$test->errors) {
push @{$self->{skip_msgs}},
("\t#".$test->soprint("-Skip: $test->{skips}\n"));
$self->{skip_cnt}++;
} elsif ($test->unsupporteds && !$test->errors) {
$self->{unsup_cnt}++;
@ -364,7 +367,14 @@ sub report {
chomp $f;
$fh->print("$f\n");
}
$fh->print("TESTS DONE: ".$self->sprint_summary."\n");
foreach my $f (sort @{$self->{skip_msgs}}) {
chomp $f;
$fh->print("$f\n");
}
my $sum = ($self->{fail_cnt} && "FAILED"
|| $self->{skip_cnt} && "PASSED w/SKIPS"
|| "PASSED");
$fh->print("TESTS DONE, $sum: ".$self->sprint_summary."\n");
}
sub print_summary {

View File

@ -13,7 +13,7 @@ use Time::HiRes;
scenarios(dist => 1);
if (!$ENV{VERILATOR_TEST_RANDOM_FAILURE}) {
skip("Test is for harness checking only, setenv VERILATOR_TEST_RANDOM_FAILURE=1 ");
ok("Test is for harness checking only, setenv VERILATOR_TEST_RANDOM_FAILURE=1 ");
} else {
# Randomly fail to test driver.pl
my ($ign, $t) = Time::HiRes::gettimeofday();