11 use File::Temp qw{ tempdir };
16 return if $File::Find::name !~ /\.pm\z/;
17 my $found = $File::Find::name;
19 $found =~ s{[/\\]}{::}g;
22 push @modules, $found;
30 my @found_scripts = ();
34 my $found = $File::Find::name;
36 open my $FH, '<', $_ or do {
37 note( "Unable to open $found in ( $! ), skipping" );
41 return unless $shebang =~ /^#!.*?\bperl\b\s*$/;
42 push @found_scripts, $found;
47 return @found_scripts;
51 do { push @scripts, _find_scripts($_) if -d $_ }
52 for qw{ bin script scripts };
54 my $plan = scalar(@modules) + scalar(@scripts);
55 $plan ? (plan tests => $plan) : (plan skip_all => "no tests to run");
58 # fake home for cpan-testers
59 local $ENV{HOME} = tempdir( CLEANUP => 1 );
61 like( qx{ $^X -Ilib -e "require $_; print '$_ ok'" }, qr/^\s*$_ ok/s, "$_ loaded ok" )
65 eval "use Test::Script 1.05; 1;";
66 skip "Test::Script needed to test script compilation", scalar(@scripts) if $@;
67 foreach my $file ( @scripts ) {
70 script_compiles( $file, "$script script compiles" );