1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
#!perl
use Test::More;
use Config ();
use Module::ScanDeps;
use Cwd;
unless( $Config::Config{usedl} ){
plan('skip_all', 'Sorry, no dynamic loading');
}
plan(tests => 2);
my $rv = scan_deps_runtime(
files => [ 't/data/check-dynaloader/Bar.pm' ],
recurse => 1,
compile => 1,
);
my ( $entry ) = grep { /^auto\b.*\bCwd\.$Config::Config{dlext}/ } keys %$rv;
ok( $entry, 'we have some key that looks like it pulled in the Cwd shared lib' );
# build a path the the Cwd library based on the entry in %INC and our Module::ScanDeps path
( my $cwd_bundle_path = $INC{ 'Cwd.pm' } ) =~ s/Cwd\.pm$/$entry/;
is( $rv->{$entry}->{file}, $cwd_bundle_path, 'the full bundle path we got looks legit' );
__END__
|