typo
[oweals/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.2";
9 @ISA = qw(Exporter);
10 @EXPORT = qw(simple_test);
11
12 =head1 NAME
13
14 OpenSSL::Test::Simple - a few very simple test functions
15
16 =head1 SYNOPSIS
17
18   use OpenSSL::Test::Simple;
19
20   simple_test("my_test_name", "des", "destest");
21
22 =head1 DESCRIPTION
23
24 Sometimes, the functions in L<OpenSSL::Test> are quite tedious for some
25 repetitive tasks.  This module provides functions to make life easier.
26 You could call them hacks if you wish.
27
28 =cut
29
30 use OpenSSL::Test;
31 use OpenSSL::Test::Utils;
32
33 =over 4
34
35 =item B<simple_test NAME, PROGRAM, ALGORITHM>
36
37 Runs a test named NAME, running the program PROGRAM with no arguments,
38 to test the algorithm ALGORITHM.
39
40 A complete recipe looks like this:
41
42   use OpenSSL::Test::Simple;
43
44   simple_test("test_bf", "bftest", "bf");
45
46 =back
47
48 =cut
49
50 # args:
51 #  name                 (used with setup())
52 #  algorithm            (used to check if it's at all supported)
53 #  name of binary       (the program that does the actual test)
54 sub simple_test {
55     my ($name, $prgr, $algo, @rest) = @_;
56
57     setup($name);
58
59     plan tests => 1;
60   SKIP: {
61       skip "$algo is not supported by this OpenSSL build, skipping this test...", 1
62           if $algo && disabled($algo);
63
64       ok(run(test([$prgr])), "running $prgr");
65     }
66 }
67
68 =head1 SEE ALSO
69
70 L<OpenSSL::Test>
71
72 =head1 AUTHORS
73
74 Richard Levitte E<lt>levitte@openssl.orgE<gt> with inspiration
75 from Rich Salz E<lt>rsalz@openssl.orgE<gt>.
76
77 =cut
78
79 1;