mirror of
https://github.com/verilator/verilator.git
synced 2025-04-29 03:56:58 +00:00
Tests: add skips
This commit is contained in:
parent
2679185a09
commit
2a192be4f5
@ -97,7 +97,7 @@ if ($#opt_tests<0) {
|
|||||||
mkdir "obj_dir";
|
mkdir "obj_dir";
|
||||||
mkdir "logs";
|
mkdir "logs";
|
||||||
|
|
||||||
my $leftcnt=0; my $okcnt=0; my $failcnt=0;
|
my $leftcnt=0; my $okcnt=0; my $failcnt=0; my $skcnt=0;
|
||||||
my @fails;
|
my @fails;
|
||||||
|
|
||||||
foreach my $testpl (@opt_tests) {
|
foreach my $testpl (@opt_tests) {
|
||||||
@ -123,6 +123,8 @@ sub one_test {
|
|||||||
$test->read;
|
$test->read;
|
||||||
if ($test->ok) {
|
if ($test->ok) {
|
||||||
$test->oprint("Test PASSED\n");
|
$test->oprint("Test PASSED\n");
|
||||||
|
} elsif ($test->skips && !$test->errors) {
|
||||||
|
$test->oprint("%Skip: $test->{skips}\n");
|
||||||
} else {
|
} else {
|
||||||
$test->error("Missing ok\n") if !$test->errors;
|
$test->error("Missing ok\n") if !$test->errors;
|
||||||
$test->oprint("%Error: $test->{errors}\n");
|
$test->oprint("%Error: $test->{errors}\n");
|
||||||
@ -134,6 +136,8 @@ sub one_test {
|
|||||||
$test->read_status;
|
$test->read_status;
|
||||||
if ($test->ok) {
|
if ($test->ok) {
|
||||||
$okcnt++;
|
$okcnt++;
|
||||||
|
} elsif ($test->skips && !$test->errors) {
|
||||||
|
$skcnt++;
|
||||||
} else {
|
} else {
|
||||||
$test->oprint("FAILED: ","*"x60,"\n");
|
$test->oprint("FAILED: ","*"x60,"\n");
|
||||||
push @fails, "\t#".$test->soprint("%Error: $test->{errors}\n");
|
push @fails, "\t#".$test->soprint("%Error: $test->{errors}\n");
|
||||||
@ -144,7 +148,7 @@ sub one_test {
|
|||||||
if ($opt_stop) { die "%Error: --stop and errors found\n"; }
|
if ($opt_stop) { die "%Error: --stop and errors found\n"; }
|
||||||
}
|
}
|
||||||
$leftcnt--;
|
$leftcnt--;
|
||||||
print "==SUMMARY: Left $leftcnt Passed $okcnt Failed $failcnt\n";
|
print "==SUMMARY: Left $leftcnt Passed $okcnt Skipped $skcnt Failed $failcnt\n";
|
||||||
},
|
},
|
||||||
)->ready();
|
)->ready();
|
||||||
}
|
}
|
||||||
@ -209,12 +213,12 @@ sub report {
|
|||||||
|
|
||||||
$fh->print("\n");
|
$fh->print("\n");
|
||||||
$fh->print("="x70,"\n");
|
$fh->print("="x70,"\n");
|
||||||
$fh->print("TESTS Passed $okcnt Failed $failcnt\n");
|
$fh->print("TESTS Passed $okcnt Skipped $skcnt Failed $failcnt\n");
|
||||||
foreach my $f (@$fails) {
|
foreach my $f (@$fails) {
|
||||||
chomp $f;
|
chomp $f;
|
||||||
$fh->print("$f\n");
|
$fh->print("$f\n");
|
||||||
}
|
}
|
||||||
$fh->print("TESTS Passed $okcnt Failed $failcnt\n");
|
$fh->print("TESTS Passed $okcnt Skipped $skcnt Failed $failcnt\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
@ -325,8 +329,8 @@ sub error {
|
|||||||
sub skip {
|
sub skip {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $msg = join('',@_);
|
my $msg = join('',@_);
|
||||||
warn "%Warning: Skip: $self->{mode}/$self->{name}: ".$msg."\n";
|
warn "%Skip: $self->{mode}/$self->{name}: ".$msg."\n";
|
||||||
$self->{errors} ||= "Skip: ".$msg;
|
$self->{skips} ||= "Skip: ".$msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub prep {
|
sub prep {
|
||||||
@ -371,7 +375,7 @@ sub read_status {
|
|||||||
sub compile {
|
sub compile {
|
||||||
my $self = (ref $_[0]? shift : $Self);
|
my $self = (ref $_[0]? shift : $Self);
|
||||||
my %param = (%{$self}, @_); # Default arguments are from $self
|
my %param = (%{$self}, @_); # Default arguments are from $self
|
||||||
return 1 if $self->errors;
|
return 1 if $self->errors || $self->skips;
|
||||||
$self->oprint("Compile\n");
|
$self->oprint("Compile\n");
|
||||||
|
|
||||||
my $checkflags = join(' ',@{$param{v_flags}},
|
my $checkflags = join(' ',@{$param{v_flags}},
|
||||||
@ -460,11 +464,11 @@ sub compile {
|
|||||||
($param{stdout_filename}?"> ".$param{stdout_filename}:""),
|
($param{stdout_filename}?"> ".$param{stdout_filename}:""),
|
||||||
);
|
);
|
||||||
if ($self->sc_or_sp && !defined $ENV{SYSTEMC}) {
|
if ($self->sc_or_sp && !defined $ENV{SYSTEMC}) {
|
||||||
$self->error("Test requires SystemC; ignore error since not installed\n");
|
$self->skip("Test requires SystemC; ignore error since not installed\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
elsif ($self->{coverage} && !$Have_System_Perl) {
|
elsif ($self->{coverage} && !$Have_System_Perl) {
|
||||||
$self->error("Test requires SystemPerl; ignore error since not installed\n");
|
$self->skip("Test requires SystemPerl; ignore error since not installed\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -472,7 +476,7 @@ sub compile {
|
|||||||
fails=>$param{fails},
|
fails=>$param{fails},
|
||||||
expect=>$param{expect},
|
expect=>$param{expect},
|
||||||
cmd=>\@vlargs);
|
cmd=>\@vlargs);
|
||||||
return 1 if $self->errors;
|
return 1 if $self->errors || $self->skips;
|
||||||
|
|
||||||
if (!$param{fails} && $param{verilator_make_gcc}) {
|
if (!$param{fails} && $param{verilator_make_gcc}) {
|
||||||
if ($param{make_main}) {
|
if ($param{make_main}) {
|
||||||
@ -500,7 +504,7 @@ sub compile {
|
|||||||
|
|
||||||
sub execute {
|
sub execute {
|
||||||
my $self = (ref $_[0]? shift : $Self);
|
my $self = (ref $_[0]? shift : $Self);
|
||||||
return 1 if $self->errors;
|
return 1 if $self->errors || $self->skips;
|
||||||
my %param = (%{$self}, @_); # Default arguments are from $self
|
my %param = (%{$self}, @_); # Default arguments are from $self
|
||||||
$self->oprint("Run\n");
|
$self->oprint("Run\n");
|
||||||
|
|
||||||
@ -551,7 +555,7 @@ sub execute {
|
|||||||
|
|
||||||
sub inline_checks {
|
sub inline_checks {
|
||||||
my $self = (ref $_[0]? shift : $Self);
|
my $self = (ref $_[0]? shift : $Self);
|
||||||
return 1 if $self->errors;
|
return 1 if $self->errors || $self->skips;
|
||||||
return 1 if !$self->{vlt};
|
return 1 if !$self->{vlt};
|
||||||
|
|
||||||
my %param = (%{$self}, @_); # Default arguments are from $self
|
my %param = (%{$self}, @_); # Default arguments are from $self
|
||||||
@ -596,7 +600,7 @@ sub inline_checks {
|
|||||||
sub ok {
|
sub ok {
|
||||||
my $self = (ref $_[0]? shift : $Self);
|
my $self = (ref $_[0]? shift : $Self);
|
||||||
$self->{ok} = $_[0] if defined $_[0];
|
$self->{ok} = $_[0] if defined $_[0];
|
||||||
$self->{ok} = 0 if $self->{errors};
|
$self->{ok} = 0 if $self->{errors} || $self->{skips};
|
||||||
return $self->{ok};
|
return $self->{ok};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -605,6 +609,11 @@ sub errors {
|
|||||||
return $self->{errors};
|
return $self->{errors};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub skips {
|
||||||
|
my $self = (ref $_[0]? shift : $Self);
|
||||||
|
return $self->{skips};
|
||||||
|
}
|
||||||
|
|
||||||
sub top_filename {
|
sub top_filename {
|
||||||
my $self = (ref $_[0]? shift : $Self);
|
my $self = (ref $_[0]? shift : $Self);
|
||||||
$self->{top_filename} = shift if defined $_[0];
|
$self->{top_filename} = shift if defined $_[0];
|
||||||
@ -670,7 +679,7 @@ sub _run {
|
|||||||
if ($param{fails} && !$status) {
|
if ($param{fails} && !$status) {
|
||||||
$self->error("Exec of $param{cmd}[0] ok, but expected to fail\n");
|
$self->error("Exec of $param{cmd}[0] ok, but expected to fail\n");
|
||||||
}
|
}
|
||||||
return if $self->errors;
|
return if $self->errors || $self->skips;
|
||||||
|
|
||||||
# Read the log file a couple of times to allow for NFS delays
|
# Read the log file a couple of times to allow for NFS delays
|
||||||
if ($param{check_finished} || $param{expect}) {
|
if ($param{check_finished} || $param{expect}) {
|
||||||
@ -1050,6 +1059,7 @@ sub file_grep_not {
|
|||||||
my $self = (ref $_[0]? shift : $Self);
|
my $self = (ref $_[0]? shift : $Self);
|
||||||
my $filename = shift;
|
my $filename = shift;
|
||||||
my $regexp = shift;
|
my $regexp = shift;
|
||||||
|
return if $self->errors || $self->skips;
|
||||||
|
|
||||||
my $contents = $self->file_contents($filename);
|
my $contents = $self->file_contents($filename);
|
||||||
return if ($contents eq "_Already_Errored_");
|
return if ($contents eq "_Already_Errored_");
|
||||||
@ -1062,6 +1072,7 @@ sub file_grep {
|
|||||||
my $self = (ref $_[0]? shift : $Self);
|
my $self = (ref $_[0]? shift : $Self);
|
||||||
my $filename = shift;
|
my $filename = shift;
|
||||||
my $regexp = shift;
|
my $regexp = shift;
|
||||||
|
return if $self->errors || $self->skips;
|
||||||
|
|
||||||
my $contents = $self->file_contents($filename);
|
my $contents = $self->file_contents($filename);
|
||||||
return if ($contents eq "_Already_Errored_");
|
return if ($contents eq "_Already_Errored_");
|
||||||
|
Loading…
Reference in New Issue
Block a user