yet another symlink bug spotted by Henk P. Penning
[rersyncrecent.git] / t / 04-run.t
blobd041302cfa36bd44b25289907abc16da936b96e2
1 #!perl -- -*- mode: cperl -*-
3 use Test::More;
4 use File::Spec;
5 sub _f ($) {File::Spec->catfile(split /\//, shift);}
7 my @s = grep {-x $_} grep { !/~/ } glob("bin/rrr*");
9 my $tests_per_loop = 3;
10 my $plan = scalar @s * $tests_per_loop;
11 plan tests => $plan;
13 my $devnull = File::Spec->devnull;
14 for my $s (1..@s) {
15   my $script = _f($s[$s-1]);
16   open my $fh, "-|", qq{"$^X" "-Ilib" "-cw" "$script" 2>&1} or die "could not fork: $!";
17   while (<$fh>) {
18       next if /syntax OK/;
19       print;
20   }
21   my $ret = close $fh;
22   ok 1==$ret, "$script:-c:$ret";
23   open $fh, "-|", qq{"$^X" "-Ilib" "$script" "-help" 2>&1} or die "could not fork: $!";
24   my $seen_usage = 0;
25   while (<$fh>) {
26     $seen_usage++ if /Usage:/;
27   }
28   $ret = close $fh;
29   ok 1==$ret, "$script:-help:ret=$ret";
30   ok 0<$seen_usage, "$script:-help:su=$seen_usage";
33 __END__
35 # Local Variables:
36 # mode: cperl
37 # cperl-indent-level: 2
38 # End: