Pass STATIC_EXT to t/porting/FindExt.t
authorJan Dubois <jand@activestate.com>
Thu, 25 Nov 2010 22:14:18 +0000 (14:14 -0800)
committerJan Dubois <jand@activestate.com>
Thu, 25 Nov 2010 22:23:06 +0000 (14:23 -0800)
The list of static extensions on Windows is only known
inside win32/Makefile and win32/makefile.mk, so we need
to somehow pass it to t/porting/FindExt.t to give it
a chance to pass on Windows.

Unfortunately this means that PERL_STATIC_EXT will have
to be set manually if this test is to be run directly
and not via the Makefile.

t/porting/FindExt.t
win32/Makefile
win32/makefile.mk

index c1be9d9..a877f8b 100644 (file)
@@ -12,6 +12,10 @@ use strict;
 # varies based on which headers are present, and which options ./Configure was
 # invoked with.
 
+if ($^O eq "MSWin32" && !defined $ENV{PERL_STATIC_EXT}) {
+    skip_all "PERL_STATIC_EXT must be set to the list of static extensions";
+}
+
 plan tests => 10;
 use FindExt;
 use Config;
@@ -19,6 +23,7 @@ use Config;
 FindExt::scan_ext('../cpan');
 FindExt::scan_ext('../dist');
 FindExt::scan_ext('../ext');
+FindExt::set_static_extensions(split ' ', $ENV{PERL_STATIC_EXT}) if $^O eq "MSWin32";
 
 # Config.pm and FindExt.pm make different choices about what should be built
 my @config_built;
index 700c900..4e1910e 100644 (file)
@@ -1260,6 +1260,7 @@ test-prep : all utils
        $(XCOPY) $(PERLEXE) ..\t\$(NULL)
        $(XCOPY) $(PERLDLL) ..\t\$(NULL)
        $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
+       set PERL_STATIC_EXT=$(STATIC_EXT)
 
 test : test-prep
        cd ..\t
index b7264aa..0c68318 100644 (file)
@@ -1663,7 +1663,8 @@ test-prep : all utils
 .ENDIF
 
 test : $(RIGHTMAKE) test-prep
-       cd ..\t && $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES)
+       set PERL_STATIC_EXT=$(STATIC_EXT) && \
+           cd ..\t && $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES)
 
 test-reonly : reonly utils
        $(XCOPY) $(PERLEXE) ..\t\$(NULL)
@@ -1677,7 +1678,8 @@ regen :
        cd .. && regen.pl && cd win32
 
 test-notty : test-prep
-       set PERL_SKIP_TTY_TEST=1 && \
+       set PERL_STATIC_EXT=$(STATIC_EXT) && \
+           set PERL_SKIP_TTY_TEST=1 && \
            cd ..\t && $(PERLEXE) -I.\lib harness $(TEST_SWITCHES) $(TEST_FILES)
 
 _test : $(RIGHTMAKE)
@@ -1688,7 +1690,8 @@ _test : $(RIGHTMAKE)
 .ELSE
        $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
 .ENDIF
-       cd ..\t && $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES)
+       set PERL_STATIC_EXT=$(STATIC_EXT) && \
+           cd ..\t && $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES)
 
 _clean :
        -@erase miniperlmain$(o)