提交 c8943eb0 编写于 作者: R Richard Levitte

OpenSSL::Test: bring back the relative paths

Because there was a bug in File::Spec::Unix' abs2rel when it was given
relative paths as both PATH and BASE arguments, the directories we
deal with were made to be all absolute.  Unfortunately, this meant
getting paths in our verbose test output which are difficult to use
anywhere else (such as a separate test build made for comparison), due
to the constant need to edit all the paths all the time.

We're therefore getting back the relative paths, by doing an extra
abs2rel() in __srctop_file, __srctop_dir, __bldtop_file and
__bldtop_dir, with a 'Cwd::getcwd' call as BASE argument.

Fixes #10628
Reviewed-by: NMatt Caswell <matt@openssl.org>
Reviewed-by: NMatthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/10913)

(cherry picked from commit 612539e8a678c6099131dfd0e5e4b85fa774eb1a)
上级 cc7c6eb8
...@@ -65,7 +65,7 @@ use File::Spec::Functions qw/file_name_is_absolute curdir canonpath splitdir ...@@ -65,7 +65,7 @@ use File::Spec::Functions qw/file_name_is_absolute curdir canonpath splitdir
rel2abs/; rel2abs/;
use File::Path 2.00 qw/rmtree mkpath/; use File::Path 2.00 qw/rmtree mkpath/;
use File::Basename; use File::Basename;
use Cwd qw/abs_path/; use Cwd qw/getcwd abs_path/;
my $level = 0; my $level = 0;
...@@ -904,26 +904,26 @@ sub __srctop_file { ...@@ -904,26 +904,26 @@ sub __srctop_file {
BAIL_OUT("Must run setup() first") if (! $test_name); BAIL_OUT("Must run setup() first") if (! $test_name);
my $f = pop; my $f = pop;
return catfile($directories{SRCTOP},@_,$f); return abs2rel(catfile($directories{SRCTOP},@_,$f),getcwd);
} }
sub __srctop_dir { sub __srctop_dir {
BAIL_OUT("Must run setup() first") if (! $test_name); BAIL_OUT("Must run setup() first") if (! $test_name);
return catdir($directories{SRCTOP},@_); return abs2rel(catdir($directories{SRCTOP},@_), getcwd);
} }
sub __bldtop_file { sub __bldtop_file {
BAIL_OUT("Must run setup() first") if (! $test_name); BAIL_OUT("Must run setup() first") if (! $test_name);
my $f = pop; my $f = pop;
return catfile($directories{BLDTOP},@_,$f); return abs2rel(catfile($directories{BLDTOP},@_,$f), getcwd);
} }
sub __bldtop_dir { sub __bldtop_dir {
BAIL_OUT("Must run setup() first") if (! $test_name); BAIL_OUT("Must run setup() first") if (! $test_name);
return catdir($directories{BLDTOP},@_); return abs2rel(catdir($directories{BLDTOP},@_), getcwd);
} }
# __exeext is a function that returns the platform dependent file extension # __exeext is a function that returns the platform dependent file extension
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册