1 package OpenSSL::Test::Simple;
7 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
10 @EXPORT = qw(simple_test);
14 OpenSSL::Test::Simple - a few very simple test functions
18 use OpenSSL::Test::Simple;
20 simple_test("my_test_name", "destest", "des");
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.
31 use OpenSSL::Test::Utils;
35 =item B<simple_test NAME, PROGRAM, ALGORITHM>
37 Runs a test named NAME, running the program PROGRAM with no arguments,
38 to test the algorithm ALGORITHM.
40 A complete recipe looks like this:
42 use OpenSSL::Test::Simple;
44 simple_test("test_bf", "bftest", "bf");
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)
55 my ($name, $prgr, @algos) = @_;
59 if (scalar(disabled(@algos))) {
60 if (scalar(@algos) == 1) {
61 plan skip_all => $algos[0]." is not supported by this OpenSSL build";
63 my $last = pop @algos;
64 plan skip_all => join(", ", @algos)." and $last are not supported by this OpenSSL build";
70 ok(run(test([$prgr])), "running $prgr");
79 Richard Levitte E<lt>levitte@openssl.orgE<gt> with inspiration
80 from Rich Salz E<lt>rsalz@openssl.orgE<gt>.