forked from monitoring-plugins/monitoring-plugins
-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.pl.in
executable file
·49 lines (36 loc) · 810 Bytes
/
test.pl.in
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
#!/usr/bin/perl -w -I .. -I ../..
#
# Wrapper for running the test harnesses
#
use strict;
use Getopt::Long;
use NPTest qw(DetermineTestHarnessDirectory TestsFrom);
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 ( !defined( $directory ) )
{
print STDERR "$0: Unable to determine the test harness directory - ABORTING\n";
exit 2;
}
@tests = TestsFrom( $directory, 1 );
}
if ( ! scalar( @tests ) )
{
print STDERR "$0: Unable to determine the test harnesses to run - ABORTING\n";
exit 3;
}
use Test::Harness;
$Test::Harness::verbose=1;
runtests( @tests );