X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=util%2Fperl%2FOpenSSL%2FTest.pm;h=4dc1bad188644a653a12eb081cd6b62c9bba4e02;hp=c44eca301c3a2b820861408f05876ab8aabae714;hb=bd60ac48a684bf1dae052a209e6624491abe8d27;hpb=d8dc853825078a7b63683d873cb9070ebc52bfda diff --git a/util/perl/OpenSSL/Test.pm b/util/perl/OpenSSL/Test.pm index c44eca301c..4dc1bad188 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 checks for environment variables (see L below), checks that C<$TOP/Configure> or C<$SRCTOP/Configure> exists, C 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 + +C 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 + +FILENAME is the name of a test output file. +C 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 LIST is a list of CODEREFs returned by C or C, from which C @@ -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 #