},
);
+plan(tests => 1 + 4 * @testcases);
+
my $find2perl = File::Spec->catfile(File::Spec->updir(), "x2p", "find2perl");
+ok (-x $find2perl, "find2perl exists");
our $TODO;
-plan(tests => scalar @testcases);
+
for my $test (@testcases) {
SKIP:
{
my $skip = $test->{SKIP} && $test->{SKIP}->();
$skip
- and skip($skip, 1);
+ and skip($skip, 4);
my $code = runperl(args => [ $find2perl, $tmpdir, @$args ]);
- unless ($code) {
- fail("$name: failed to run findperl");
- next;
- }
+ ok($code, "$name: run findperl")
+ or skip("", 3);
open my $script_fh, ">", $script
or die "Cannot create $script: $!";
or die "Cannot close $script: $!";
my $files = runperl(progfile => $script);
+
+ ok(length $files, "$name: run output script")
+ or skip("", 2);
+
my $find_files;
my $source;
if ($test->{expect}) {
map { $_ eq "" ? $tmpdir : "$tmpdir/$_" }
@{$test->{expect}};
$source = "expected";
+ # to balance the ok() in the other branch
+ pass("$name: got files ok");
}
else {
my $findcmd = "find $tmpdir ". join " ", map "'$_'", @$args;
# make sure PERL_UNICODE doesn't reinterpret the output of find
use open IN => ':raw';
$find_files = `$findcmd`;
+ ok(length $find_files, "$name: run find")
+ or skip("", 1);
$source = "find";
}