ps-watcher/tests/basic.t.in

33 lines
637 B
Perl
Executable file

#!@PERL@ -w
# $Id: basic.t.in,v 1.8 2006/03/10 19:07:06 rockyb Exp $
# Some basic checks
use strict;
use Test::More;
if ( '@PS_TIME_VAR@' ) {
plan( tests => 5);
} else {
plan( tests => 4 );
}
my $test='basic';
my $cmd = "@PERL@ ../ps-watcher --log --nosyslog --nodaemon "
. "--sleep -1 --config $test.cnf";
my @output = `$cmd 2>&1`;
# First line is Id line. This doesn't count in testing.
shift @output;
my $i=1;
foreach (@output) {
s/.+:\s+//;
$i++ if (!'@PS_TIME_VAR@' && $i==3);
my $result = sprintf "ok %d", $i;
$i++;
ok($_ =~ m{$result});
}
#;;; Local Variables: ***
#;;; mode:perl ***
#;;; End: ***