File: basic.t.in

package info (click to toggle)
ps-watcher 1.08-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 772 kB
  • sloc: sh: 2,907; perl: 1,281; makefile: 104
file content (32 lines) | stat: -rwxr-xr-x 637 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!@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: ***