use POSIX;
use File::Spec::Functions qw/catfile/;
use File::Compare qw/compare_text/;
-use OpenSSL::Test qw/:DEFAULT top_dir top_file/;
+use OpenSSL::Test qw/:DEFAULT srctop_dir srctop_file/;
+use OpenSSL::Test::Utils;
setup("test_cms");
-my $smdir = top_dir("test", "smime-certs");
-my $smcont = top_file("test", "smcont.txt");
-my $no_ec = run(app(["openssl", "no-ec"], stdout => undef));
-my $no_ec2m = run(app(["openssl", "no-ec2m"], stdout => undef));
-my $no_ecdh = run(app(["openssl", "no-ecdh"], stdout => undef));
+my $smdir = srctop_dir("test", "smime-certs");
+my $smcont = srctop_file("test", "smcont.txt");
+my ($no_dh, $no_ec, $no_ec2m, $no_zlib) = disabled qw/dh ec ec2m zlib/;
plan tests => 4;
SKIP: {
skip("Zlib not supported: compression tests skipped",
scalar @smime_cms_comp_tests)
- unless grep /ZLIB/, run(app(["openssl", "version", "-f"]),
- capture => 1);
+ if $no_zlib;
- foreach (@smime_cms_param_tests) {
+ foreach (@smime_cms_comp_tests) {
SKIP: {
my $skip_reason = check_availability($$_[0]);
skip $skip_reason, 1 if $skip_reason;
return "$tnam: skipped, EC disabled\n"
if ($no_ec && $tnam =~ /ECDH/);
return "$tnam: skipped, ECDH disabled\n"
- if ($no_ecdh && $tnam =~ /ECDH/);
+ if ($no_ec && $tnam =~ /ECDH/);
return "$tnam: skipped, EC2M disabled\n"
if ($no_ec2m && $tnam =~ /K-283/);
+ return "$tnam: skipped, DH disabled\n"
+ if ($no_dh && $tnam =~ /X9\.42/);
return "";
}