Allow skipping of tests if Date::Parse not installed.
authorGreg Sabino Mullane <greg@endpoint.com>
Tue, 21 Jul 2009 00:41:49 +0000 (20:41 -0400)
committerGreg Sabino Mullane <greg@endpoint.com>
Tue, 21 Jul 2009 00:41:49 +0000 (20:41 -0400)
t/02_checkpoint.t

index de342ba692d1970452f50440f3017b648857560a..1ee870a593c331b2fc3eb3820afc22dd6f1816db 100644 (file)
@@ -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;