aboutsummaryrefslogtreecommitdiff
path: root/test.pl.in
blob: 2f2c44f226e44064d50fe79a4e1ae7b7c890287d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/perl -w -I .. -I ../..
#
# Wrapper for running the test harnesses
#

use strict;

use Getopt::Long;

use NPTest qw(DetermineTestHarnessDirectory TestsFrom);

$ENV{LC_ALL} = 'C';

my @tstdir;

if ( ! GetOptions( "testdir:s" => \@tstdir ) )
{
  print "Usage: ${0} [--testdir=<directory>] [<test_harness.t> ...]\n";
  exit 1;
}

my @tests;

if ( scalar( @ARGV ) )
{
  @tests = @ARGV;
}
else
{
  my @directory = DetermineTestHarnessDirectory( @tstdir );

  if ( @directory == 0 )
  {
    print STDERR "$0: Unable to determine the test harness directory - ABORTING\n";
    exit 2;
  }

  for my $d ( @directory )
  {
    push (@tests, TestsFrom( $d, 1 ));
  }
}

if ( ! scalar( @tests ) )
{
  print STDERR "$0: Unable to determine the test harnesses to run - ABORTING\n";
  exit 3;
}

use Test::Harness;

runtests( @tests );