mirror of
https://github.com/verilator/verilator.git
synced 2025-01-03 21:27:35 +00:00
Tests: Fix CCache test not properly skipped (#3643)
If the skip condition happens, the rest still runs and it fails. Don't do that.
This commit is contained in:
parent
4931e48016
commit
1b18eee5dc
@ -44,6 +44,7 @@ HyungKi Jeong
|
||||
Iru Cai
|
||||
Ivan Vnučec
|
||||
Iztok Jeras
|
||||
Jake Merdich
|
||||
James Hanlon
|
||||
James Hutchinson
|
||||
James Pallister
|
||||
|
@ -13,36 +13,37 @@ scenarios(vlt => 1);
|
||||
if (!$Self->cfg_with_ccache) {
|
||||
skip("Requires configuring with ccache");
|
||||
}
|
||||
else {
|
||||
top_filename("t_a1_first_cc.v");
|
||||
|
||||
top_filename("t_a1_first_cc.v");
|
||||
# This test requires rebuilding the object files to check the ccache log
|
||||
foreach my $filename (glob("$Self->{obj_dir}/*.o")) {
|
||||
print "rm $filename\n" if $Self->{verbose};
|
||||
unlink $filename;
|
||||
}
|
||||
|
||||
# This test requires rebuilding the object files to check the ccache log
|
||||
foreach my $filename (glob("$Self->{obj_dir}/*.o")) {
|
||||
print "rm $filename\n" if $Self->{verbose};
|
||||
unlink $filename;
|
||||
compile(
|
||||
verilator_flags2 => ['--trace'],
|
||||
make_flags => "ccache-report"
|
||||
);
|
||||
|
||||
my $report = "$Self->{obj_dir}/$Self->{VM_PREFIX}__ccache_report.txt";
|
||||
|
||||
# We do not actually want to make this test depend on whether the file was
|
||||
# cached or not, so trim the report to ignore actual caching behaviour
|
||||
run(cmd => ["sed", "-i", "-e", "'s/ : .*/ : IGNORED/; /|/s/.*/IGNORED/;'", $report]);
|
||||
files_identical($report, "t/$Self->{name}__ccache_report_initial.out");
|
||||
|
||||
# Now rebuild again (should be all up to date)
|
||||
run(
|
||||
logfile => "$Self->{obj_dir}/rebuild.log",
|
||||
cmd => ["make", "-C", $Self->{obj_dir},
|
||||
"-f", "$Self->{VM_PREFIX}.mk",
|
||||
$Self->{VM_PREFIX}, "ccache-report"]
|
||||
);
|
||||
|
||||
files_identical($report, "t/$Self->{name}__ccache_report_rebuild.out");
|
||||
}
|
||||
|
||||
compile(
|
||||
verilator_flags2 => ['--trace'],
|
||||
make_flags => "ccache-report"
|
||||
);
|
||||
|
||||
my $report = "$Self->{obj_dir}/$Self->{VM_PREFIX}__ccache_report.txt";
|
||||
|
||||
# We do not actually want to make this test depend on whether the file was
|
||||
# cached or not, so trim the report to ignore actual caching behaviour
|
||||
run(cmd => ["sed", "-i", "-e", "'s/ : .*/ : IGNORED/; /|/s/.*/IGNORED/;'", $report]);
|
||||
files_identical($report, "t/$Self->{name}__ccache_report_initial.out");
|
||||
|
||||
# Now rebuild again (should be all up to date)
|
||||
run(
|
||||
logfile => "$Self->{obj_dir}/rebuild.log",
|
||||
cmd => ["make", "-C", $Self->{obj_dir},
|
||||
"-f", "$Self->{VM_PREFIX}.mk",
|
||||
$Self->{VM_PREFIX}, "ccache-report"]
|
||||
);
|
||||
|
||||
files_identical($report, "t/$Self->{name}__ccache_report_rebuild.out");
|
||||
|
||||
ok(1);
|
||||
1;
|
||||
|
Loading…
Reference in New Issue
Block a user