diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:48:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:48:22 +0000 |
commit | 7373ce3d6988706388f136e1c06afd20a3e8d5be (patch) | |
tree | e9ae5af7d102667e5706187646db45de8238e8c4 /test.pl.in | |
parent | Initial commit. (diff) | |
download | monitoring-plugins-7373ce3d6988706388f136e1c06afd20a3e8d5be.tar.xz monitoring-plugins-7373ce3d6988706388f136e1c06afd20a3e8d5be.zip |
Adding upstream version 2.3.5.upstream/2.3.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test.pl.in')
-rwxr-xr-x | test.pl.in | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/test.pl.in b/test.pl.in new file mode 100755 index 0000000..2f2c44f --- /dev/null +++ b/test.pl.in @@ -0,0 +1,52 @@ +#!/usr/bin/perl -w -I .. -I ../.. +# +# Wrapper for running the test harnesses +# + +use strict; + +use Getopt::Long; + +use NPTest qw(DetermineTestHarnessDirectory TestsFrom); + +$ENV{LC_ALL} = 'C'; + +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 ( @directory == 0 ) + { + print STDERR "$0: Unable to determine the test harness directory - ABORTING\n"; + exit 2; + } + + for my $d ( @directory ) + { + push (@tests, TestsFrom( $d, 1 )); + } +} + +if ( ! scalar( @tests ) ) +{ + print STDERR "$0: Unable to determine the test harnesses to run - ABORTING\n"; + exit 3; +} + +use Test::Harness; + +runtests( @tests ); |