bring the two inotify->watch calls into one sub and add some error conditions that...
[rersyncrecent.git] / t / 04-run.t
blobb483e68905806af7a6fe32c827f7bd71b18e5523
1 #!perl -- -*- mode: cperl -*-
3 use Test::More;
4 use File::Spec;
5 sub _f ($) {File::Spec->catfile(split /\//, shift);}
7 my $Id = q$Id: bap.t 26 2003-02-16 19:01:03Z k $;
9 my @s = grep {-x $_} grep { !/~/ } glob("bin/rrr*");
11 my $tests_per_loop = 3;
12 my $plan = scalar @s * $tests_per_loop;
13 plan tests => $plan;
15 my $devnull = File::Spec->devnull;
16 for my $s (1..@s) {
17   my $script = _f($s[$s-1]);
18   open my $fh, "-|", qq{"$^X" "-Ilib" "-cw" "$script" 2>&1} or die "could not fork: $!";
19   while (<$fh>) {
20       next if /syntax OK/;
21       print;
22   }
23   my $ret = close $fh;
24   ok 1==$ret, "$script:-c:$ret";
25   open $fh, "-|", qq{"$^X" "-Ilib" "$script" "-help" 2>&1} or die "could not fork: $!";
26   my $seen_usage = 0;
27   while (<$fh>) {
28     $seen_usage++ if /Usage:/;
29   }
30   $ret = close $fh;
31   ok 1==$ret, "$script:-help:ret=$ret";
32   ok 0<$seen_usage, "$script:-help:su=$seen_usage";
35 __END__
37 # Local Variables:
38 # mode: cperl
39 # cperl-indent-level: 2
40 # End: