This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Move the test for Win32's FindExt.pm to t/porting, and run it automatically.
authorNicholas Clark <nick@ccl4.org>
Sun, 21 Nov 2010 19:13:01 +0000 (19:13 +0000)
committerNicholas Clark <nick@ccl4.org>
Sun, 21 Nov 2010 19:13:01 +0000 (19:13 +0000)
The test was written as part of the work on migrating modules to cpan/ and
dist/, but at that time at least one of FindExt.pm and Configure was buggy with
the classification of at least one module (XS or non-XS). As that is now fixed,
move the test to t/porting, and run it routinely. This will ensure that the
Win32 code's classification of modules will remain consistent with Configure's.

MANIFEST
t/porting/FindExt.t [moved from win32/FindExt.t with 72% similarity]

index 8067c53..fc692f7 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -4790,6 +4790,7 @@ t/porting/checkcase.t             Check whether we are case-insensitive-fs-friendly
 t/porting/diag.t               Test completeness of perldiag.pod
 t/porting/dual-life.t          Check that dual-life bins are in utils/
 t/porting/exec-bit.t           Check that exec-bit bins are identified
+t/porting/FindExt.t            Test win32/FindExt.pm
 t/porting/maintainers.t                Test that Porting/Maintaners.pl is up to date
 t/porting/manifest.t           Test that this MANIFEST file is well formed
 t/porting/podcheck.t           Test the POD of shipped modules is well formed
@@ -4988,7 +4989,6 @@ win32/create_perllibst_h.pl       creates perllibst.h file for inclusion from perllib.
 win32/distclean.bat            Remove _ALL_ files not listed here in MANIFEST
 win32/fcrypt.c                 crypt() implementation
 win32/FindExt.pm               Scan for extensions
-win32/FindExt.t                        Test FindExt.pm
 win32/genmk95.pl               Perl code to generate command.com-usable makefile.95
 win32/include/arpa/inet.h      Win32 port
 win32/include/dirent.h         Win32 port
similarity index 72%
rename from win32/FindExt.t
rename to t/porting/FindExt.t
index d521fa9..c1be9d9 100644 (file)
@@ -2,14 +2,22 @@
 
 BEGIN {
     @INC = qw(../win32 ../lib);
+    require './test.pl';
 }
 use strict;
 
-use Test::More tests => 10;
+# Test that Win32/FindExt.pm is consistent with Configure in determining the
+# types of extensions.
+# It's not possible to check the list of built dynamic extensions, as that
+# varies based on which headers are present, and which options ./Configure was
+# invoked with.
+
+plan tests => 10;
 use FindExt;
 use Config;
 
 FindExt::scan_ext('../cpan');
+FindExt::scan_ext('../dist');
 FindExt::scan_ext('../ext');
 
 # Config.pm and FindExt.pm make different choices about what should be built
@@ -39,5 +47,5 @@ foreach (['static_ext',
     my @config = sort split ' ', $config;
     is (scalar @$found, scalar @config,
        "We find the same number of $type");
-    is_deeply($found, \@config, "We find the same");
+    is ("@$found", "@config", "We find the same list of $type");
 }