activate GID and EGID after a case where it would have helped:
[cpan-testers-parsereport.git] / t / run.t
blob09a4356215703374cf5bcbd8f9b6084cae8ff1d8
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/ctgetreports
11           );
13 my $tests_per_loop = 3;
14 my $plan = scalar @s * $tests_per_loop;
15 plan tests => $plan;
17 my $devnull = File::Spec->devnull;
18 for my $s (1..@s) {
19   my $script = _f($s[$s-1]);
20   open my $fh, "-|", qq{"$^X" "-Ilib" "-cw" "$script" 2>&1} or die "could not fork: $!";
21   while (<$fh>) {
22       next if /syntax OK/;
23       print;
24   }
25   my $ret = close $fh;
26   ok 1==$ret, "$script:-c:$ret";
27   open $fh, "-|", qq{"$^X" "-Ilib" "$script" "-help" 2>&1} or die "could not fork: $!";
28   my $seen_usage = 0;
29   while (<$fh>) {
30     $seen_usage++ if /Usage:/;
31   }
32   $ret = close $fh;
33   ok 1==$ret, "$script:-help:ret=$ret";
34   ok 0<$seen_usage, "$script:-help:su=$seen_usage";
37 __END__
39 # Local Variables:
40 # mode: cperl
41 # cperl-indent-level: 2
42 # End: