be86ca2cb2564b1a8dcfb1fae9dd8524350582ca
[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 Test::More 0.96;
14 use OpenSSL::Test;
15
16 # args:
17 #  name                 (used with setup())
18 #  algorithm            (used to check if it's at all supported)
19 #  name of binary       (the program that does the actual test)
20 sub simple_test {
21     my ($name, $prgr, $algo, @rest) = @_;
22
23     setup($name);
24
25     plan tests => 1;
26   SKIP: {
27       skip "$algo is not supported by this OpenSSL build, skipping this test...", 1
28           if $algo && run(app(["openssl", "no-$algo"]));
29
30       ok(run(test([$prgr])), "running $prgr");
31     }
32 }