Change OpenSSL::Test to be an extension of Test::More
[openssl.git] / test / testlib / OpenSSL / Test / Simple.pm
1 package OpenSSL::Test::Simple;
2
3 use strict;
4 use warnings;
5
6 use Exporter;
7 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
8 $VERSION = "0.1";
9 @ISA = qw(Exporter);
10 @EXPORT = qw(simple_test);
11
12
13 use OpenSSL::Test;
14
15 # args:
16 #  name                 (used with setup())
17 #  algorithm            (used to check if it's at all supported)
18 #  name of binary       (the program that does the actual test)
19 sub simple_test {
20     my ($name, $prgr, $algo, @rest) = @_;
21
22     setup($name);
23
24     plan tests => 1;
25   SKIP: {
26       skip "$algo is not supported by this OpenSSL build, skipping this test...", 1
27           if $algo && run(app(["openssl", "no-$algo"]));
28
29       ok(run(test([$prgr])), "running $prgr");
30     }
31 }