diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2007-09-24 18:45:59 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2007-09-24 18:45:59 +0000 |
commit | 6625e6a0d2a4cec99339b8b526035592dcd4418c (patch) | |
tree | 85971687f4bfef6a7f30595522f2454c73f4b2af /t | |
parent | 7fb5ed0f0a95ce5817e0b0f7c3bba91968393d49 (diff) | |
download | monitoring-plugin-perl-6625e6a0d2a4cec99339b8b526035592dcd4418c.tar.gz |
Help, usage and version output go to stdout now, rather than stderr
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1795 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 't')
-rw-r--r-- | t/Nagios-Plugin-Getopt-01.t | 3 | ||||
-rw-r--r-- | t/Nagios-Plugin-Getopt-02.t | 3 | ||||
-rw-r--r-- | t/Nagios-Plugin-Getopt-04.t | 3 | ||||
-rwxr-xr-x | t/check_stuff.t | 24 |
4 files changed, 16 insertions, 17 deletions
diff --git a/t/Nagios-Plugin-Getopt-01.t b/t/Nagios-Plugin-Getopt-01.t index bad1367..7076d75 100644 --- a/t/Nagios-Plugin-Getopt-01.t +++ b/t/Nagios-Plugin-Getopt-01.t | |||
@@ -5,6 +5,9 @@ use strict; | |||
5 | use Test::More tests => 76; | 5 | use Test::More tests => 76; |
6 | BEGIN { use_ok('Nagios::Plugin::Getopt') }; | 6 | BEGIN { use_ok('Nagios::Plugin::Getopt') }; |
7 | 7 | ||
8 | # Needed to get evals to work in testing | ||
9 | Nagios::Plugin::Functions::_use_die(1); | ||
10 | |||
8 | my %PARAM = ( | 11 | my %PARAM = ( |
9 | version => '0.01', | 12 | version => '0.01', |
10 | url => 'http://www.openfusion.com.au/labs/nagios/', | 13 | url => 'http://www.openfusion.com.au/labs/nagios/', |
diff --git a/t/Nagios-Plugin-Getopt-02.t b/t/Nagios-Plugin-Getopt-02.t index 26e0293..f83b180 100644 --- a/t/Nagios-Plugin-Getopt-02.t +++ b/t/Nagios-Plugin-Getopt-02.t | |||
@@ -5,6 +5,9 @@ use strict; | |||
5 | use Test::More tests => 14; | 5 | use Test::More tests => 14; |
6 | BEGIN { use_ok('Nagios::Plugin::Getopt') }; | 6 | BEGIN { use_ok('Nagios::Plugin::Getopt') }; |
7 | 7 | ||
8 | # Needed to get evals to work in testing | ||
9 | Nagios::Plugin::Functions::_use_die(1); | ||
10 | |||
8 | my %PARAM = ( | 11 | my %PARAM = ( |
9 | version => '0.01', | 12 | version => '0.01', |
10 | url => 'http://www.openfusion.com.au/labs/nagios/', | 13 | url => 'http://www.openfusion.com.au/labs/nagios/', |
diff --git a/t/Nagios-Plugin-Getopt-04.t b/t/Nagios-Plugin-Getopt-04.t index 9092636..115f2a2 100644 --- a/t/Nagios-Plugin-Getopt-04.t +++ b/t/Nagios-Plugin-Getopt-04.t | |||
@@ -5,6 +5,9 @@ use strict; | |||
5 | use Test::More tests => 11; | 5 | use Test::More tests => 11; |
6 | BEGIN { use_ok('Nagios::Plugin::Getopt') }; | 6 | BEGIN { use_ok('Nagios::Plugin::Getopt') }; |
7 | 7 | ||
8 | # Needed to get evals to work in testing | ||
9 | Nagios::Plugin::Functions::_use_die(1); | ||
10 | |||
8 | my %PARAM = ( | 11 | my %PARAM = ( |
9 | version => '0.01', | 12 | version => '0.01', |
10 | usage => "Don't use this plugin!", | 13 | usage => "Don't use this plugin!", |
diff --git a/t/check_stuff.t b/t/check_stuff.t index 2d2ce38..64f95ae 100755 --- a/t/check_stuff.t +++ b/t/check_stuff.t | |||
@@ -2,7 +2,7 @@ | |||
2 | # | 2 | # |
3 | use strict; use warnings; | 3 | use strict; use warnings; |
4 | #use Test::More qw(no_plan); | 4 | #use Test::More qw(no_plan); |
5 | use Test::More tests => 16; | 5 | use Test::More tests => 14; |
6 | 6 | ||
7 | my ($r,$args); | 7 | my ($r,$args); |
8 | my $s = 't/check_stuff.pl'; | 8 | my $s = 't/check_stuff.pl'; |
@@ -22,23 +22,13 @@ $r = `$s`; | |||
22 | is $?>>8 , $e{UNKNOWN}, "exits($e{UNKNOWN}) with no args"; | 22 | is $?>>8 , $e{UNKNOWN}, "exits($e{UNKNOWN}) with no args"; |
23 | like $r, qr/^$n UNKNOWN/, "UNKNOWN with no args"; | 23 | like $r, qr/^$n UNKNOWN/, "UNKNOWN with no args"; |
24 | 24 | ||
25 | $r = `$s -V`; | ||
26 | is $?>>8 , $e{UNKNOWN}, "exits($e{UNKNOWN}) with -V arg"; | ||
27 | like $r, qr/^[\w\.]+ \d+/i, "looks like there's a version"; | ||
25 | 28 | ||
26 | #TODO: | 29 | $r = `$s -h`; |
27 | SKIP: { | 30 | is $?>>8 , $e{UNKNOWN}, "exits($e{UNKNOWN}) with -h arg"; |
28 | local $TODO = q~d'oh! we'll have to redirect STDERR and check it with like() here instead of checking `` which only gets STDIN. Maybe use IPC::Open3?~; | 31 | like $r, qr/usage/i, "looks like there's something helpful"; # broken |
29 | skip "too noisy, see TODO here", 6; | ||
30 | |||
31 | $r = `$s -V`; | ||
32 | is $?>>8 , $e{UNKNOWN}, "exits($e{UNKNOWN}) with -V arg"; | ||
33 | like $r, qr/\d+\.\d/i, "looks like there's a version"; # broken | ||
34 | is $r, '', "prints nothing to STDOUT"; | ||
35 | |||
36 | $r = `$s -h`; | ||
37 | is $?>>8 , $e{UNKNOWN}, "exits($e{UNKNOWN}) with -h arg"; | ||
38 | like $r, qr/usage/i, "looks like there's something helpful"; # broken | ||
39 | is $r, '', "prints nothing to STDOUT"; | ||
40 | } | ||
41 | |||
42 | 32 | ||
43 | $args = " -r 99 "; | 33 | $args = " -r 99 "; |
44 | diag "running `$s $args`" if $ENV{TEST_VERBOSE}; | 34 | diag "running `$s $args`" if $ENV{TEST_VERBOSE}; |