Fix OpenSSL::Test::Simple to take more than one algorithm
[openssl.git] / test / testlib / OpenSSL / Test / Simple.pm
index 96500fcabaae8bddd4f303cf319735bf09a845d6..b596e5f2e877940b70dad5e3d5832f1df3c85187 100644 (file)
@@ -17,7 +17,7 @@ OpenSSL::Test::Simple - a few very simple test functions
 
   use OpenSSL::Test::Simple;
 
-  simple_test("my_test_name", "des", "destest");
+  simple_test("my_test_name", "destest", "des");
 
 =head1 DESCRIPTION
 
@@ -52,17 +52,22 @@ A complete recipe looks like this:
 #  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) = @_;
+    my ($name, $prgr, @algos) = @_;
 
     setup($name);
 
+    if (scalar(disabled(@algos))) {
+       if (scalar(@algos) == 1) {
+           plan skip_all => $algos[0]." is not supported by this OpenSSL build";
+       } else {
+           my $last = pop @algos;
+           plan skip_all => join(", ", @algos)." and $last are not supported by this OpenSSL build";
+       }
+    }
+
     plan tests => 1;
-  SKIP: {
-      skip "$algo is not supported by this OpenSSL build, skipping this test...", 1
-         if $algo && disabled($algo);
 
-      ok(run(test([$prgr])), "running $prgr");
-    }
+    ok(run(test([$prgr])), "running $prgr");
 }
 
 =head1 SEE ALSO
@@ -72,7 +77,7 @@ L<OpenSSL::Test>
 =head1 AUTHORS
 
 Richard Levitte E<lt>levitte@openssl.orgE<gt> with inspiration
-from Rich Salz E<lt>rsalz@openssl.org<gt>.
+from Rich Salz E<lt>rsalz@openssl.orgE<gt>.
 
 =cut