aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-09-23 18:58:17 +0200
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-10-06 21:45:25 +0200
commitbd60ac48a684bf1dae052a209e6624491abe8d27 (patch)
tree30853ec4d9be1a0f6e78cea5640d708dd00c333b
parentd8dc853825078a7b63683d873cb9070ebc52bfda (diff)
downloadopenssl-bd60ac48a684bf1dae052a209e6624491abe8d27.zip
openssl-bd60ac48a684bf1dae052a209e6624491abe8d27.tar.gz
openssl-bd60ac48a684bf1dae052a209e6624491abe8d27.tar.bz2
Test.pm: Add result_dir and export both result_dir and result_file
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/12934)
-rw-r--r--util/perl/OpenSSL/Test.pm49
1 files changed, 40 insertions, 9 deletions
diff --git a/util/perl/OpenSSL/Test.pm b/util/perl/OpenSSL/Test.pm
index c44eca3..4dc1bad 100644
--- a/util/perl/OpenSSL/Test.pm
+++ b/util/perl/OpenSSL/Test.pm
@@ -21,6 +21,7 @@ $VERSION = "1.0";
@EXPORT_OK = (@Test::More::EXPORT_OK, qw(bldtop_dir bldtop_file
srctop_dir srctop_file
data_file data_dir
+ result_file result_dir
pipe with cmdstr quotify
openssl_versions
ok_nofips is_nofips isnt_nofips));
@@ -124,8 +125,8 @@ most likely refuse to run.
C<setup> checks for environment variables (see L</ENVIRONMENT> below),
checks that C<$TOP/Configure> or C<$SRCTOP/Configure> exists, C<chdir>
into the results directory (defined by the C<$RESULT_D> environment
-variable if defined, otherwise C<$BLDTOP/test> or C<$TOP/test>, whichever
-is defined).
+variable if defined, otherwise C<$BLDTOP/test-runs> or C<$TOP/test-runs>,
+whichever is defined).
=back
@@ -651,6 +652,43 @@ sub data_file {
=over 4
+=item B<result_dir>
+
+C<result_dir> returns the directory where test output files should be placed
+as a string, adapted to the local operating system.
+
+=back
+
+=cut
+
+sub result_dir {
+ BAIL_OUT("Must run setup() first") if (! $test_name);
+
+ return catfile($directories{RESULTS});
+}
+
+=over 4
+
+=item B<result_file FILENAME>
+
+FILENAME is the name of a test output file.
+C<result_file> returns the path of the given file as a string,
+prepending to the file name the path to the directory where test output files
+should be placed, adapted to the local operating system.
+
+=back
+
+=cut
+
+sub result_file {
+ BAIL_OUT("Must run setup() first") if (! $test_name);
+
+ my $f = pop;
+ return catfile(result_dir(),@_,$f);
+}
+
+=over 4
+
=item B<pipe LIST>
LIST is a list of CODEREFs returned by C<app> or C<test>, from which C<pipe>
@@ -1067,13 +1105,6 @@ sub __data_dir {
return catdir($directories{SRCDATA},@_);
}
-sub __results_file {
- BAIL_OUT("Must run setup() first") if (! $test_name);
-
- my $f = pop;
- return catfile($directories{RESULTS},@_,$f);
-}
-
# __cwd DIR
# __cwd DIR, OPTS
#