The advantage of doing a wildcard rm instead of deleting the files
individually is that you can use $n for temporary files, which are not
mentioned as explicit inputs or outputs in the test case.
my @out_files = ();
my @out_checks = ();
my @out_files = ();
my @out_checks = ();
my $redirs = "";
if (defined $tt->{'In'}) {
my $redirs = "";
if (defined $tt->{'In'}) {
print X $tt->{'In'}, "\n";
close X;
$redirs .= " <$ifi";
print X $tt->{'In'}, "\n";
close X;
$redirs .= " <$ifi";
} else {
$redirs .= " </dev/null";
}
} else {
$redirs .= " </dev/null";
}
my $ofi = "tmp/test$i.out";
unlink "$rundir/$ofi";
$redirs .= " >$ofi";
my $ofi = "tmp/test$i.out";
unlink "$rundir/$ofi";
$redirs .= " >$ofi";
push @out_files, $ofi;
push @out_checks, $tt->{'Out'};
} else {
push @out_files, $ofi;
push @out_checks, $tt->{'Out'};
} else {
my $f = "tmp/test$i.$arg";
if (defined $tt->{"Out$arg"}) {
unlink "$rundir/$f";
my $f = "tmp/test$i.$arg";
if (defined $tt->{"Out$arg"}) {
unlink "$rundir/$f";
push @out_files, $f;
push @out_checks, $tt->{"Out$arg"};
}
push @out_files, $f;
push @out_checks, $tt->{"Out$arg"};
}
open X, ">$rundir/$f" or die "Unable to create $f";
print X $tt->{"In$arg"}, "\n";
close X;
open X, ">$rundir/$f" or die "Unable to create $f";
print X $tt->{"In$arg"}, "\n";
close X;
}
}
$run =~ s/\$(\d)/tmp\/test$i.$1/g;
}
}
$run =~ s/\$(\d)/tmp\/test$i.$1/g;
- foreach my $f (@temps) {
- unlink "$rundir/$f";
- }
+ system "rm $rundir/tmp/test$i.*";