Commit | Line | Data |
0598b5ab |
1 | #!../miniperl -w |
2 | |
3 | BEGIN { |
4 | @INC = qw(../win32 ../lib); |
5 | } |
6 | use strict; |
7 | |
8 | use Test::More tests => 10; |
9 | use FindExt; |
10 | use Config; |
11 | |
12 | FindExt::scan_ext('../ext'); |
13 | |
14 | # Config.pm and FindExt.pm make different choices about what should be built |
15 | my @config_built; |
16 | my @found_built; |
17 | { |
18 | foreach my $type (qw(static dynamic nonxs)) { |
19 | push @found_built, eval "FindExt::${type}_ext()"; |
20 | push @config_built, split ' ', $Config{"${type}_ext"}; |
21 | } |
22 | } |
23 | @config_built = sort @config_built; |
24 | @found_built = sort @found_built; |
25 | |
26 | foreach (['static_ext', |
27 | [FindExt::static_ext()], $Config{static_ext}], |
28 | ['nonxs_ext', |
29 | [FindExt::nonxs_ext()], $Config{nonxs_ext}], |
30 | ['known_extensions', |
31 | [FindExt::known_extensions()], $Config{known_extensions}], |
32 | ['"config" dynamic + static + nonxs', |
33 | \@config_built, $Config{extensions}], |
34 | ['"found" dynamic + static + nonxs', |
35 | \@found_built, join " ", FindExt::extensions()], |
36 | ) { |
37 | my ($type, $found, $config) = @$_; |
38 | my @config = sort split ' ', $config; |
39 | is (scalar @$found, scalar @config, |
40 | "We find the same number of $type"); |
41 | is_deeply($found, \@config, "We find the same"); |
42 | } |