pkg-monitoring-plugins/test.pl.in

52 lines
868 B
Perl
Raw Permalink Normal View History

2013-11-26 22:53:19 +00:00
#!/usr/bin/perl -w -I .. -I ../..
#
# Wrapper for running the test harnesses
#
2013-11-26 22:54:42 +00:00
# $Id: test.pl.in 1207 2005-07-25 01:47:15Z illumino $
2013-11-26 22:53:19 +00:00
#
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 );