6 $PERL -e 1 > /dev/null 2>&1 || {
7 echo 1>&2 "$0: configure didn't find a usable version of Perl," \
8 "so can't run this test"
12 exec $PERL -w -I$srcdir/.. -MCoreutils -- - << \EOF
16 (my $program_name = $0) =~ s|.*/||;
18 # Turn off localisation of executable's ouput.
19 @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
22 my $mkdir = {PRE => sub {mkdir $d,0100 or die "$d: $!\n"}};
23 my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
27 # test-name options input expected-output
29 ['unreadable-1', '-rf', $d,
30 {EXIT => 1}, {ERR => "$prog: $d/.: Permission denied\n"}, $mkdir],
31 ['unreadable-2', '-rf', $d,
33 {ERR => "$prog: $d/.: Permission denied\n" .
34 "$prog: cannot remove directory `$d': File exists\n"},
35 {PRE => sub { (mkdir $d,0700 and mkdir "$d/x",0700 and chmod 0100,$d)
36 or die "$d: $!\n"}} ],
39 my $save_temps = $ENV{SAVE_TEMPS};
40 my $verbose = $ENV{VERBOSE};
42 my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);