Remove old testing scripts out of the way.
[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
14 # It seems that $switches is getting interpretted with 'eval' or something
15 # like that, and that we need to take care of backslashes or they will
16 # disappear along the way.
17 $testlib =~ s|\\|\\\\|g if $^O eq "MSWin32";
18
19 # Test::Harness provides the variable $switches to give it
20 # switches to be used when it calls our recipes.
21 $switches = "-w \"-I$testlib\"";
22
23 my @tests = ( "alltests" );
24 if (@ARGV) {
25     @tests = @ARGV;
26 }
27 if (grep /^alltests$/, @tests) {
28     @tests = grep {
29         basename($_) =~ /^[0-9][0-9]-[^\.]*\.t$/
30     } glob(catfile($recipesdir,"*.t"));
31 } else {
32     my @t = ();
33     foreach (@tests) {
34         push @t, grep {
35             basename($_) =~ /^[0-9][0-9]-[^\.]*\.t$/
36         } glob(catfile($recipesdir,"*-$_.t"));
37     }
38     @tests = @t;
39 }
40
41 @tests = map { abs2rel($_, rel2abs(curdir())); } @tests;
42
43 runtests(sort @tests);