Constify ECDSA_METHOD_new.
[openssl.git] / test / run_tests.pl
1 #! /usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use File::Spec::Functions qw/catdir catfile curdir abs2rel rel2abs/;
7 use File::Basename;
8 use Test::Harness qw/runtests $switches/;
9
10 my $top = $ENV{TOP};
11 my $recipesdir = catdir($top, "test", "recipes");
12 my $testlib = catdir($top, "test", "testlib");
13 my $utillib = catdir($top, "util");
14
15 # It seems that $switches is getting interpretted with 'eval' or something
16 # like that, and that we need to take care of backslashes or they will
17 # disappear along the way.
18 $testlib =~ s|\\|\\\\|g if $^O eq "MSWin32";
19 $utillib =~ s|\\|\\\\|g if $^O eq "MSWin32";
20
21 # Test::Harness provides the variable $switches to give it
22 # switches to be used when it calls our recipes.
23 $switches = "-w \"-I$testlib\" \"-I$utillib\"";
24
25 my @tests = ( "alltests" );
26 if (@ARGV) {
27     @tests = @ARGV;
28 }
29 if (grep /^alltests$/, @tests) {
30     @tests = grep {
31         basename($_) =~ /^[0-9][0-9]-[^\.]*\.t$/
32     } glob(catfile($recipesdir,"*.t"));
33 } else {
34     my @t = ();
35     foreach (@tests) {
36         push @t, grep {
37             basename($_) =~ /^[0-9][0-9]-[^\.]*\.t$/
38         } glob(catfile($recipesdir,"*-$_.t"));
39     }
40     @tests = @t;
41 }
42
43 @tests = map { abs2rel($_, rel2abs(curdir())); } @tests;
44
45 runtests(sort @tests);