Commit | Line | Data |
---|---|---|
0598b5ab NC |
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 | ||
57ad57e0 | 12 | FindExt::scan_ext('../cpan'); |
0598b5ab NC |
13 | FindExt::scan_ext('../ext'); |
14 | ||
15 | # Config.pm and FindExt.pm make different choices about what should be built | |
16 | my @config_built; | |
17 | my @found_built; | |
18 | { | |
19 | foreach my $type (qw(static dynamic nonxs)) { | |
20 | push @found_built, eval "FindExt::${type}_ext()"; | |
21 | push @config_built, split ' ', $Config{"${type}_ext"}; | |
22 | } | |
23 | } | |
24 | @config_built = sort @config_built; | |
25 | @found_built = sort @found_built; | |
26 | ||
27 | foreach (['static_ext', | |
28 | [FindExt::static_ext()], $Config{static_ext}], | |
29 | ['nonxs_ext', | |
30 | [FindExt::nonxs_ext()], $Config{nonxs_ext}], | |
31 | ['known_extensions', | |
32 | [FindExt::known_extensions()], $Config{known_extensions}], | |
33 | ['"config" dynamic + static + nonxs', | |
34 | \@config_built, $Config{extensions}], | |
35 | ['"found" dynamic + static + nonxs', | |
36 | \@found_built, join " ", FindExt::extensions()], | |
37 | ) { | |
38 | my ($type, $found, $config) = @$_; | |
39 | my @config = sort split ' ', $config; | |
40 | is (scalar @$found, scalar @config, | |
41 | "We find the same number of $type"); | |
42 | is_deeply($found, \@config, "We find the same"); | |
43 | } |