prepare for the release
[rersyncrecent.git] / t / 04-run.t
blobab458e194e2a661e23aad1e5b8f98895aa8de84d
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 = qw(
10            bin/rrr-aggregate
11            bin/rrr-dirtyupdate
12            bin/rrr-news
13            bin/rrr-overview
14           );
16 my $tests_per_loop = 3;
17 my $plan = scalar @s * $tests_per_loop;
18 plan tests => $plan;
20 my $devnull = File::Spec->devnull;
21 for my $s (1..@s) {
22   my $script = _f($s[$s-1]);
23   open my $fh, "-|", qq{"$^X" "-Ilib" "-cw" "$script" 2>&1} or die "could not fork: $!";
24   while (<$fh>) {
25       next if /syntax OK/;
26       print;
27   }
28   my $ret = close $fh;
29   ok 1==$ret, "$script:-c:$ret";
30   open $fh, "-|", qq{"$^X" "-Ilib" "$script" "-help" 2>&1} or die "could not fork: $!";
31   my $seen_usage = 0;
32   while (<$fh>) {
33     $seen_usage++ if /Usage:/;
34   }
35   $ret = close $fh;
36   ok 1==$ret, "$script:-help:ret=$ret";
37   ok 0<$seen_usage, "$script:-help:su=$seen_usage";
40 __END__
42 # Local Variables:
43 # mode: cperl
44 # cperl-indent-level: 2
45 # End: