pkg-monitoring-plugins/test.pl.in

52 lines
872 B
Perl
Raw Normal View History

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