#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_bf");
-
-plan tests => 1;
-ok(run(test(["bftest"])), "running bftest");
+simple_test("test_bf", "bftest", "bf");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_cast");
-
-plan tests => 1;
-ok(run(test(["casttest"])), "running casttest");
+simple_test("test_cast", "casttest", "cast");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_des");
-
-plan tests => 1;
-ok(run(test(["destest"])), "running destest");
+simple_test("test_des", "destest", "des");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_hmac");
-
-plan tests => 1;
-ok(run(test(["hmactest"])), "running hmactest");
+simple_test("test_hmac", "hmactest", "hmac");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_idea");
-
-plan tests => 1;
-ok(run(test(["ideatest"])), "running ideatest");
+simple_test("test_idea", "ideatest", "idea");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_md2");
-
-plan tests => 1;
-ok(run(test(["md2test"])), "running md2test");
+simple_test("test_md2", "md2test", "md2");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_md4");
-
-plan tests => 1;
-ok(run(test(["md4test"])), "running md4test");
+simple_test("test_md4", "md4test", "md4");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_md5");
-
-plan tests => 1;
-ok(run(test(["md5test"])), "running md5test");
+simple_test("test_md5", "md5test", "md5");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_mdc2");
-
-plan tests => 1;
-ok(run(test(["mdc2test"])), "running mdc2test");
+simple_test("test_mdc2", "mdc2test", "mdc2");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_rand");
-
-plan tests => 1;
-ok(run(test(["randtest"])), "running randtest");
+simple_test("test_rand", "randtest", "rand");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_rc2");
-
-plan tests => 1;
-ok(run(test(["rc2test"])), "running rc2test");
+simple_test("test_rc2", "rc2test", "rc2");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_rc4");
-
-plan tests => 1;
-ok(run(test(["rc4test"])), "running rc4test");
+simple_test("test_rc4", "rc4test", "rc4");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_rc5");
-
-plan tests => 1;
-ok(run(test(["rc5test"])), "running rc5test");
+simple_test("test_rc5", "rc5test", "rc5");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_rmd");
-
-plan tests => 1;
-ok(run(test(["rmdtest"])), "running rmdtest");
+simple_test("test_rmd", "rmdtest", "rmd");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_sha1");
-
-plan tests => 1;
-ok(run(test(["sha1test"])), "running sha1test");
+simple_test("test_sha1", "sha1test", "sha1");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_sha256");
-
-plan tests => 1;
-ok(run(test(["sha256t"])), "running sha256t");
+simple_test("test_sha256", "sha256t", "sha256");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_sha512");
-
-plan tests => 1;
-ok(run(test(["sha512t"])), "running sha512t");
+simple_test("test_sha512", "sha512t", "sha512");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_wp");
-
-plan tests => 1;
-ok(run(test(["wp_test"])), "running wp_test");
+simple_test("test_wp", "wptest", "wp");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_exp");
-
-plan tests => 1;
-ok(run(test(["exptest"])), "running exptest");
+simple_test("test_exp", "exptest");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_dh");
-
-plan tests => 1;
-ok(run(test(["dhtest"])), "running dhtest");
+simple_test("test_dh", "dhtest", "dh");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_ecdh");
-
-plan tests => 1;
-ok(run(test(["ecdhtest"])), "running ecdhtest");
+simple_test("test_ecdh", "ecdhtest", "ecdh");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_ecdsa");
-
-plan tests => 1;
-ok(run(test(["ecdsatest"])), "running ecdsatest");
+simple_test("test_ecdsa", "ecdsatest", "ecdsa");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_constant_time");
-
-plan tests => 1;
-ok(run(test(["constant_time_test"])), "running constant_time_test");
+simple_test("test_constant_time", "constant_time_test");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_heartbeat");
-
-plan tests => 1;
-ok(run(test(["heartbeat_test"])), "running heartbeat_test");
+simple_test("test_heartbeat", "heartbeat_test");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_ige");
-
-plan tests => 1;
-ok(run(test(["igetest"])), "running igetest");
+simple_test("test_ige", "igetest");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_jpake");
-
-plan tests => 1;
-ok(run(test(["jpaketest"])), "running jpaketest");
+simple_test("test_jpake", "jpaketest");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_p5_crpt2");
-
-plan tests => 1;
-ok(run(test(["p5_crpt2_test"])), "running p5_crpt2_test");
+simple_test("test_p5_crpt2", "p5_crpt2_test");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_srp");
-
-plan tests => 1;
-ok(run(test(["srptest"])), "running srptest");
+simple_test("test_srp", "srptest");
#! /usr/bin/perl
-use strict;
-use warnings;
+use OpenSSL::Test::Simple;
-use Test::More;
-use OpenSSL::Test;
-
-setup("test_v3name");
-
-plan tests => 1;
-ok(run(test(["v3nametest"])), "running v3nametest");
+simple_test("test_v3name", "v3nametest");
--- /dev/null
+package OpenSSL::Test::Simple;
+
+use strict;
+use warnings;
+
+use Exporter;
+use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+$VERSION = "0.1";
+@ISA = qw(Exporter);
+@EXPORT = qw(simple_test);
+
+
+use Test::More;
+use OpenSSL::Test;
+
+# args:
+# name (used with setup())
+# algorithm (used to check if it's at all supported)
+# name of binary (the program that does the actual test)
+sub simple_test {
+ my ($name, $prgr, $algo, @rest) = @_;
+
+ setup($name);
+
+ plan tests => 1;
+ SKIP: {
+ skip "$algo is not supported by this OpenSSL build, skipping this test...", 1
+ if $algo && run(app(["openssl", "no-$algo"]));
+
+ ok(run(test([$prgr])), "running $prgr");
+ }
+}