summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2013-06-17 10:50:33 +0200
committerNicholas Clark <nick@ccl4.org>2013-07-02 15:33:28 +0200
commite298842055e9af7cdfaee43509096b8dcbb7036c (patch)
treea3a962bf37f152a7a48b44b201374b67dc4a6e05 /t
parentef04dc3ea7996faa32bab00ea42b66d7f7901e59 (diff)
downloadperl-e298842055e9af7cdfaee43509096b8dcbb7036c.tar.gz
Skip most of FindExt's tests for troublesome configurations.
There are various various things that break the test's assumptions. 1) If Encode is a static extension, then Configure has special case logic to add Encode/* as static extensions 2) -Uusedl causes Encode to be a static extension, and drops building XS::APItest and XS::Typemap 3) Any use of -Dnoextensions to choose not to build a extension is not known by the test If any of these are true, FindExt::extensions() and $Config{extensions} will differ, and most of the tests are going to fail. Moreover, failure doesn't tell us anything interesting. So don't run those tests.
Diffstat (limited to 't')
-rw-r--r--t/porting/FindExt.t60
1 files changed, 32 insertions, 28 deletions
diff --git a/t/porting/FindExt.t b/t/porting/FindExt.t
index f690b4a360..478dca952c 100644
--- a/t/porting/FindExt.t
+++ b/t/porting/FindExt.t
@@ -16,11 +16,6 @@ if ($^O eq "MSWin32" && !defined $ENV{PERL_STATIC_EXT}) {
skip_all "PERL_STATIC_EXT must be set to the list of static extensions";
}
-unless (defined $Config{usedl}) {
- skip_all "FindExt just plain broken for static perl.";
-}
-
-plan tests => 12;
require FindExt;
FindExt::apply_config(\%Config);
@@ -38,33 +33,42 @@ sub compare {
is("@have", "@$want", "We find the same list of $desc");
}
-# Config.pm and FindExt.pm make different choices about what should be built
-my @config_built;
-my @found_built;
-{
+unless (join (' ', sort split ' ', $Config{extensions})
+ eq join(' ', FindExt::extensions())) {
+ # There are various things that break our assumptions.
+ # If Encode is a static extension, then Configure has special case logic
+ # to add Encode/* as static extensions
+ # -Uusedl causes Encode to be a static extension, and drops building
+ # XS::APItest and XS::Typemap
+ # Any use of -Dnoextensions to choose not to build a extension
+
+ plan(tests => 2);
+ note("configured extension list doesn't match, so only minimal testing is possible");
+ compare('known_extensions', $Config{known_extensions},
+ FindExt::known_extensions());
+} else {
+ # dynamic linking, and all possible extensions for this system were built,
+ # so can test everything.
+ plan(tests => 12);
+
+ compare('known_extensions', $Config{known_extensions},
+ FindExt::known_extensions());
+
+ # Config.pm and FindExt.pm make different choices about what should be built
+ my @config_built;
+ my @found_built;
+
foreach my $type (qw(static dynamic nonxs)) {
- push @found_built, eval "FindExt::${type}_ext()";
+ my @this_found = eval "FindExt::${type}_ext()";
+ push @found_built, @this_found;
push @config_built, split ' ', $Config{"${type}_ext"};
+ compare("${type}_ext", $Config{"${type}_ext"}, @this_found);
}
-}
-@config_built = sort @config_built;
-@found_built = sort @found_built;
-foreach (['dynamic_ext',
- [FindExt::dynamic_ext()], $Config{dynamic_ext}],
- ['static_ext',
- [FindExt::static_ext()], $Config{static_ext}],
- ['nonxs_ext',
- [FindExt::nonxs_ext()], $Config{nonxs_ext}],
- ['known_extensions',
- [FindExt::known_extensions()], $Config{known_extensions}],
- ['"config" dynamic + static + nonxs',
- \@config_built, $Config{extensions}],
- ['"found" dynamic + static + nonxs',
- \@found_built, [FindExt::extensions()]],
- ) {
- my ($type, $found, $config) = @$_;
- compare($type, $config, @$found);
+ compare('"config" dynamic + static + nonxs', $Config{extensions},
+ sort @config_built);
+ compare('"found" dynamic + static + nonxs', [FindExt::extensions()],
+ sort @found_built);
}
# Local variables: