summaryrefslogtreecommitdiff
path: root/tests/run-tests.pl
blob: 6136eac5b47bc5d2346b22ff40f0bffc50f0999e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /usr/bin/env perl

use strict;

use Test::Harness qw(&runtests $verbose);
$verbose = (defined $ENV{'VERBOSE'} ? $ENV{'VERBOSE'} : 0);
my $tests = (defined $ENV{'RUNTESTS'} ? $ENV{'RUNTESTS'} : '');

my $srcdir = (defined $ENV{'srcdir'} ? $ENV{'srcdir'} : '.');

opendir DIR, $srcdir;
my (@fs, $f);
while ($f = readdir(DIR)) {
	if ($f =~ /^(.*)\.t$/) {
		next if ($tests ne '' and $tests !~ /(^|\s+)$1(\s+|$)/);
		push @fs, $srcdir.'/'.$f;
	}
}
closedir DIR;
runtests (sort @fs);