mirror of
https://git.savannah.gnu.org/git/make.git
synced 2024-11-28 01:06:48 +00:00
* tests/test_driver.pl: Add cd to the .run output file
This commit is contained in:
parent
ec348f51d0
commit
63b602e74f
1 changed files with 17 additions and 13 deletions
|
@ -184,12 +184,11 @@ sub resetENV
|
|||
# so it can either be a ref of a list or a string.
|
||||
sub cmd2str
|
||||
{
|
||||
my @c;
|
||||
my $cmd = $_[0];
|
||||
if (!ref($cmd)) {
|
||||
return $cmd;
|
||||
}
|
||||
|
||||
my @c;
|
||||
push @c, $cmd;
|
||||
} else {
|
||||
foreach (@$cmd) {
|
||||
if (/[][#;"*?&|<>(){}\$`^~!]/) {
|
||||
s/\'/\'\\'\'/g;
|
||||
|
@ -198,7 +197,12 @@ sub cmd2str
|
|||
push @c, $_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($testpath eq $cwd) {
|
||||
return join(' ', @c);
|
||||
}
|
||||
return "(cd $testpath && " . join(' ', @c) . ')';
|
||||
}
|
||||
|
||||
sub toplevel
|
||||
|
@ -255,7 +259,7 @@ sub toplevel
|
|||
# Locate the top source directory.
|
||||
$toppath = File::Spec->rel2abs(File::Spec->updir(), $srcpath);
|
||||
|
||||
$cwd = cwd();
|
||||
local $cwd = cwd();
|
||||
|
||||
$workpath = "$workdir";
|
||||
|
||||
|
@ -649,7 +653,7 @@ sub run_all_tests
|
|||
$perl_testname = File::Spec->catfile($scriptpath, $testname);
|
||||
-f $perl_testname or die "Invalid test: $testname\n\n";
|
||||
|
||||
$testpath = File::Spec->catdir($workpath, $testname);
|
||||
local $testpath = File::Spec->catdir($workpath, $testname);
|
||||
|
||||
remove_directory_tree($testpath);
|
||||
mkdir($testpath, 0777) or &error("Couldn't mkdir $testpath: $!\n", 1);
|
||||
|
|
Loading…
Reference in a new issue