mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-02-19 02:27:55 -05:00
Complete rewrite of the original testing infrastructure and all test cases (to use the new infrastructure) See NPTest.pm and issue 1185704 for more details. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1207 f882894a-f735-0410-b71e-b25c423dba1c
51 lines
820 B
Perl
Executable file
51 lines
820 B
Perl
Executable file
#!/usr/bin/perl -w -I .. -I ../..
|
|
#
|
|
# Wrapper for running the test harnesses
|
|
#
|
|
# $Id$
|
|
#
|
|
|
|
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 );
|