aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRichard Levitte <richard@levitte.org>2016-01-25 15:48:35 +0100
committerRichard Levitte <richard@levitte.org>2016-01-25 17:53:55 +0100
commit83365051f5d91dece1973016dbdd6ce7541a5bcf (patch)
treea752b7cfd97211b091f643b132763a753147880a /test
parentdc193c9c5e914c74fd0f51fe4fe86fbd5910536e (diff)
downloadopenssl-83365051f5d91dece1973016dbdd6ce7541a5bcf.tar.gz
Make tests use configdata.pm rather than parsing Makefile
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'test')
-rwxr-xr-xtest/recipes/70-test_sslcertstatus.t4
-rwxr-xr-xtest/recipes/70-test_sslextension.t4
-rwxr-xr-xtest/recipes/70-test_sslsessiontick.t4
-rwxr-xr-xtest/recipes/70-test_sslskewith0p.t4
-rwxr-xr-xtest/recipes/70-test_sslvertol.t4
-rw-r--r--test/recipes/70-test_tlsextms.t4
-rw-r--r--test/testlib/OpenSSL/Test/Utils.pm22
7 files changed, 26 insertions, 20 deletions
diff --git a/test/recipes/70-test_sslcertstatus.t b/test/recipes/70-test_sslcertstatus.t
index 65a5ec1f22..f7c6363cbb 100755
--- a/test/recipes/70-test_sslcertstatus.t
+++ b/test/recipes/70-test_sslcertstatus.t
@@ -67,9 +67,7 @@ plan skip_all => "$test_name needs the engine feature enabled"
if disabled("engine");
plan skip_all => "$test_name can only be performed with OpenSSL configured shared"
- unless (map { s/\R//; s/^SHARED_LIBS=\s*//; $_ }
- grep { /^SHARED_LIBS=/ }
- do { local @ARGV = ( top_file("Makefile") ); <> })[0] ne "";
+ if config("no_shared");
$ENV{OPENSSL_ENGINES} = top_dir("engines");
$ENV{OPENSSL_ia32cap} = '~0x200000200000000';
diff --git a/test/recipes/70-test_sslextension.t b/test/recipes/70-test_sslextension.t
index 29cff45ee0..31632a717a 100755
--- a/test/recipes/70-test_sslextension.t
+++ b/test/recipes/70-test_sslextension.t
@@ -67,9 +67,7 @@ plan skip_all => "$test_name needs the engine feature enabled"
if disabled("engine");
plan skip_all => "$test_name can only be performed with OpenSSL configured shared"
- unless (map { s/\R//; s/^SHARED_LIBS=\s*//; $_ }
- grep { /^SHARED_LIBS=/ }
- do { local @ARGV = ( top_file("Makefile") ); <> })[0] ne "";
+ if config("no_shared");
$ENV{OPENSSL_ENGINES} = top_dir("engines");
$ENV{OPENSSL_ia32cap} = '~0x200000200000000';
diff --git a/test/recipes/70-test_sslsessiontick.t b/test/recipes/70-test_sslsessiontick.t
index 84fc4df7fd..84ab66199d 100755
--- a/test/recipes/70-test_sslsessiontick.t
+++ b/test/recipes/70-test_sslsessiontick.t
@@ -68,9 +68,7 @@ plan skip_all => "$test_name needs the engine feature enabled"
if disabled("engine");
plan skip_all => "$test_name can only be performed with OpenSSL configured shared"
- unless (map { s/\R//; s/^SHARED_LIBS=\s*//; $_ }
- grep { /^SHARED_LIBS=/ }
- do { local @ARGV = ( top_file("Makefile") ); <> })[0] ne "";
+ if config("no_shared");
$ENV{OPENSSL_ENGINES} = top_dir("engines");
$ENV{OPENSSL_ia32cap} = '~0x200000200000000';
diff --git a/test/recipes/70-test_sslskewith0p.t b/test/recipes/70-test_sslskewith0p.t
index c31ea0ddfd..39c0409427 100755
--- a/test/recipes/70-test_sslskewith0p.t
+++ b/test/recipes/70-test_sslskewith0p.t
@@ -67,9 +67,7 @@ plan skip_all => "$test_name needs the engine feature enabled"
if disabled("engine");
plan skip_all => "$test_name can only be performed with OpenSSL configured shared"
- unless (map { s/\R//; s/^SHARED_LIBS=\s*//; $_ }
- grep { /^SHARED_LIBS=/ }
- do { local @ARGV = ( top_file("Makefile") ); <> })[0] ne "";
+ if config("no_shared");
plan skip_all => "dh is not supported by this OpenSSL build"
if disabled("dh");
diff --git a/test/recipes/70-test_sslvertol.t b/test/recipes/70-test_sslvertol.t
index d626763575..c711d86fb5 100755
--- a/test/recipes/70-test_sslvertol.t
+++ b/test/recipes/70-test_sslvertol.t
@@ -67,9 +67,7 @@ plan skip_all => "$test_name needs the engine feature enabled"
if disabled("engine");
plan skip_all => "$test_name can only be performed with OpenSSL configured shared"
- unless (map { s/\R//; s/^SHARED_LIBS=\s*//; $_ }
- grep { /^SHARED_LIBS=/ }
- do { local @ARGV = ( top_file("Makefile") ); <> })[0] ne "";
+ if config("no_shared");
$ENV{OPENSSL_ENGINES} = top_dir("engines");
$ENV{OPENSSL_ia32cap} = '~0x200000200000000';
diff --git a/test/recipes/70-test_tlsextms.t b/test/recipes/70-test_tlsextms.t
index b6ff47e840..a861064ee1 100644
--- a/test/recipes/70-test_tlsextms.t
+++ b/test/recipes/70-test_tlsextms.t
@@ -68,9 +68,7 @@ plan skip_all => "$test_name needs the engine feature enabled"
if disabled("engine");
plan skip_all => "$test_name can only be performed with OpenSSL configured shared"
- unless (map { s/\R//; s/^SHARED_LIBS=\s*//; $_ }
- grep { /^SHARED_LIBS=/ }
- do { local @ARGV = ( top_file("Makefile") ); <> })[0] ne "";
+ if config("no_shared");
$ENV{OPENSSL_ENGINES} = top_dir("engines");
$ENV{OPENSSL_ia32cap} = '~0x200000200000000';
diff --git a/test/testlib/OpenSSL/Test/Utils.pm b/test/testlib/OpenSSL/Test/Utils.pm
index 5312c205a0..eed44244b8 100644
--- a/test/testlib/OpenSSL/Test/Utils.pm
+++ b/test/testlib/OpenSSL/Test/Utils.pm
@@ -7,7 +7,7 @@ use Exporter;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
$VERSION = "0.1";
@ISA = qw(Exporter);
-@EXPORT = qw(disabled);
+@EXPORT = qw(disabled config);
=head1 NAME
@@ -19,13 +19,15 @@ OpenSSL::Test::Utils - test utility functions
disabled("dh");
+ config("no_shared");
+
=head1 DESCRIPTION
This module provides utility functions for the testing framework.
=cut
-use OpenSSL::Test;
+use OpenSSL::Test qw/:DEFAULT top_file/;
=over 4
@@ -36,6 +38,10 @@ In a scalar context returns 1 if any of the features in ARRAY is disabled.
In an array context returns an array with each element set to 1 if the
corresponding feature is disabled and 0 otherwise.
+=item B<config STRING>
+
+Returns an item from the %config hash in \$TOP/configdata.pm.
+
=back
=cut
@@ -70,6 +76,18 @@ sub disabled {
return 0;
}
+our %config;
+sub config {
+ if (!%config) {
+ # We eval it so it doesn't run at compile time of this file.
+ # The latter would have top_dir() complain that setup() hasn't
+ # been run yet.
+ my $configdata = top_file("configdata.pm");
+ eval { require $configdata; %config = %configdata::config };
+ }
+ return $config{$_[0]};
+}
+
=head1 SEE ALSO
L<OpenSSL::Test>