From bbab366aa667c660598bc3b80c9281ae2ccb013a Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Mon, 20 Jul 2009 20:41:49 -0400 Subject: Allow skipping of tests if Date::Parse not installed. --- t/02_checkpoint.t | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/t/02_checkpoint.t b/t/02_checkpoint.t index de342ba69..1ee870a59 100644 --- a/t/02_checkpoint.t +++ b/t/02_checkpoint.t @@ -47,6 +47,15 @@ my $dbh = $cp->get_dbh(); $dbh->do('CHECKPOINT'); $dbh->commit(); $host =~ s/socket$//; +my $result = $cp->run(qq{-w 20 --datadir="$host"}); + +SKIP: +{ + +if ($result =~ /Date::Parse/) { + skip 'Cannot test checkpoint action unless Date::Parse module is installed', 6; +} + like ($cp->run(qq{-w 20 --datadir="$host"}), qr{^$label OK}, $t); $t=qq{$S returns a warning when checkpoint older than warning option}; @@ -65,4 +74,6 @@ like ($cp->run(qq{-c 1 --output=MRTG --datadir="$host"}), qr{^\d\n0\n\nLast chec $t=qq{$S returns the expected output for MRTG}; like ($cp->run(qq{-c 199 --output=MRTG --datadir="$host"}), qr{^\d\n0\n\nLast checkpoint was \d seconds ago}, $t); +} + exit; -- cgit v1.2.3