From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- web/attachments/130868-test.pl | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 web/attachments/130868-test.pl (limited to 'web/attachments/130868-test.pl') diff --git a/web/attachments/130868-test.pl b/web/attachments/130868-test.pl new file mode 100644 index 0000000..22d0576 --- /dev/null +++ b/web/attachments/130868-test.pl @@ -0,0 +1,51 @@ +#!/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=] [ ...]\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 ); -- cgit v1.2.3-74-g34f1