Tests: Show entering/exit so goto-error works on compile errors.

This commit is contained in:
Wilson Snyder 2020-01-24 22:40:19 -05:00
parent a4e8d39932
commit 708fd36563

View File

@ -1057,6 +1057,7 @@ sub compile {
if (!$param{fails} && $param{verilator_make_gmake}) {
$self->oprint("Running make (gmake)\n") if $self->{verbose};
$self->_run(logfile => "$self->{obj_dir}/vlt_gcc.log",
entering => "$self->{obj_dir}",
cmd => ["make",
"-C ".$self->{obj_dir},
"-f ".$::RealBin."/Makefile_obj",
@ -1416,7 +1417,8 @@ sub run {
}
sub _run {
my $self = (ref $_[0]? shift : $Self);
my %param = (tee=>1,
my %param = (tee => 1,
#entering => # Print entering directory information
@_);
my $command = join(' ',@{$param{cmd}});
$command = "time $command" if $opt_benchmark && $command !~ /^cd /;
@ -1438,6 +1440,8 @@ sub _run {
my $pid=fork();
if ($pid) { # Parent
close CHILDWR;
print "driver: Entering directory '",
File::Spec->rel2abs($param{entering}), "'\n" if $param{entering};
while (1) {
my $buf = '';
my $got = sysread PARENTRD,$buf,10000;
@ -1447,6 +1451,8 @@ sub _run {
}
close PARENTRD;
close $logfh if $logfh;
print "driver: Leaving directory '",
File::Spec->rel2abs($param{entering}), "'\n" if $param{entering};
}
else { # Child
close PARENTRD;