diff options
Diffstat (limited to 'deps/openssl/openssl/util/perl/OpenSSL/Test.pm')
-rw-r--r-- | deps/openssl/openssl/util/perl/OpenSSL/Test.pm | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/deps/openssl/openssl/util/perl/OpenSSL/Test.pm b/deps/openssl/openssl/util/perl/OpenSSL/Test.pm index 5de7b58e8b..a6be487895 100644 --- a/deps/openssl/openssl/util/perl/OpenSSL/Test.pm +++ b/deps/openssl/openssl/util/perl/OpenSSL/Test.pm @@ -21,7 +21,8 @@ $VERSION = "0.8"; @EXPORT_OK = (@Test::More::EXPORT_OK, qw(bldtop_dir bldtop_file srctop_dir srctop_file data_file - pipe with cmdstr quotify)); + pipe with cmdstr quotify + openssl_versions)); =head1 NAME @@ -695,6 +696,32 @@ sub quotify { return map { $arg_formatter->($_) } @_; } +=over 4 + +=item B<openssl_versions> + +Returns a list of two numbers, the first representing the build version, +the second representing the library version. See opensslv.h for more +information on those numbers. + += back + +=cut + +my @versions = (); +sub openssl_versions { + unless (@versions) { + my %lines = + map { s/\R$//; + /^(.*): (0x[[:xdigit:]]{8})$/; + die "Weird line: $_" unless defined $1; + $1 => hex($2) } + run(test(['versions']), capture => 1); + @versions = ( $lines{'Build version'}, $lines{'Library version'} ); + } + return @versions; +} + ###################################################################### # private functions. These are never exported. |