1 package OpenSSL::Test::Utils;
7 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
10 @EXPORT = qw(disabled config);
14 OpenSSL::Test::Utils - test utility functions
18 use OpenSSL::Test::Utils;
26 This module provides utility functions for the testing framework.
30 use OpenSSL::Test qw/:DEFAULT top_file/;
34 =item B<disabled ARRAY>
36 In a scalar context returns 1 if any of the features in ARRAY is disabled.
38 In an array context returns an array with each element set to 1 if the
39 corresponding feature is disabled and 0 otherwise.
41 =item B<config STRING>
43 Returns an item from the %config hash in \$TOP/configdata.pm.
53 #print STDERR "Running check_disabled\n";
54 foreach (run(app(["openssl", "list", "-disabled"]), capture => 1)) {
56 next if /:/; # skip header
63 # list of features to check
65 check_disabled() unless $disabled_set;
69 push @ret, exists $disabled{lc $_} ? 1 : 0;
74 return 1 if exists $disabled{lc $_};
82 # We eval it so it doesn't run at compile time of this file.
83 # The latter would have top_dir() complain that setup() hasn't
85 my $configdata = top_file("configdata.pm");
86 eval { require $configdata; %config = %configdata::config };
88 return $config{$_[0]};
97 Stephen Henson E<lt>steve@openssl.orgE<gt> with inspiration
98 from Richard Levitte E<lt>levitte@openssl.orgE<gt>