]> git.ipfire.org Git - thirdparty/openssl.git/blame - test/run_tests.pl
Remove outdated conftest.c
[thirdparty/openssl.git] / test / run_tests.pl
CommitLineData
aec27d4d
RL
1#! /usr/bin/perl
2
3use strict;
4use warnings;
5
6use File::Spec::Functions qw/catdir catfile curdir abs2rel rel2abs/;
7use File::Basename;
8use Test::Harness qw/runtests $switches/;
9
10my $top = $ENV{TOP};
11my $recipesdir = catdir($top, "test", "recipes");
12my $testlib = catdir($top, "test", "testlib");
25be5f44 13my $utillib = catdir($top, "util");
aec27d4d
RL
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";
25be5f44 19$utillib =~ s|\\|\\\\|g if $^O eq "MSWin32";
aec27d4d
RL
20
21# Test::Harness provides the variable $switches to give it
22# switches to be used when it calls our recipes.
25be5f44 23$switches = "-w \"-I$testlib\" \"-I$utillib\"";
aec27d4d
RL
24
25my @tests = ( "alltests" );
26if (@ARGV) {
27 @tests = @ARGV;
28}
1780e6d9
RL
29my $list_mode = scalar(grep /^list$/, @tests) != 0;
30if (grep /^alltests|list$/, @tests) {
aec27d4d
RL
31 @tests = grep {
32 basename($_) =~ /^[0-9][0-9]-[^\.]*\.t$/
33 } glob(catfile($recipesdir,"*.t"));
34} else {
35 my @t = ();
36 foreach (@tests) {
37 push @t, grep {
38 basename($_) =~ /^[0-9][0-9]-[^\.]*\.t$/
39 } glob(catfile($recipesdir,"*-$_.t"));
40 }
41 @tests = @t;
42}
43
1780e6d9
RL
44if ($list_mode) {
45 @tests = map { $_ = basename($_); $_ =~ s/^[0-9][0-9]-//; $_ =~ s/\.t$//;
46 $_ } @tests;
47 print join("\n", @tests), "\n";
48} else {
49 @tests = map { abs2rel($_, rel2abs(curdir())); } @tests;
aec27d4d 50
1780e6d9
RL
51 runtests(sort @tests);
52}