develooper Front page | perl.perl5.porters | Postings from July 2013

[perl #115076] Refactor ext/Pod-Functions/Functions_pm.PL to use test.pl

Thread Next
From:
Tony Cook via RT
Date:
July 25, 2013 06:31
Subject:
[perl #115076] Refactor ext/Pod-Functions/Functions_pm.PL to use test.pl
Message ID:
rt-3.6.HEAD-2552-1374733894-1007.115076-15-0@perl.org
On Mon Oct 08 09:39:31 2012, smueller@cpan.org wrote:
> On 10/08/2012 05:28 PM, demerphq wrote:
> >> Because the code in your patch *doesn't* only run when --tap is > >
Generally switching to a string eval is the solution.
> 
> Or
> 
> require Foo;
> Foo->import;

The patch below in addition to the Test::More version of the patch allows:

  make -j3 ext/Pod-Functions/pm_to_blib

to pass.

I'll apply this squeezed into the original patch in a couple of days
unless someone objects (along with a $VERSION bump)

Tony

From 8b13585e6bd383acbbde64296fcc7fdbf508d92f Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Thu, 25 Jul 2013 16:27:17 +1000
Subject: [PATCH 2/2] load Test::More only when generating pod

---
 ext/Pod-Functions/Functions_pm.PL |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ext/Pod-Functions/Functions_pm.PL
b/ext/Pod-Functions/Functions_pm.PL
index d4d8c93..2feebb3 100644
--- a/ext/Pod-Functions/Functions_pm.PL
+++ b/ext/Pod-Functions/Functions_pm.PL
@@ -7,7 +7,8 @@ my ($tap, $test, %Missing);
 BEGIN {
     @ARGV = grep { not($_ eq '--tap' and $tap = 1) } @ARGV;
     if ($tap) {
-        eval { use Test::More; };
+        require Test::More;
+        Test::More->import();
     }
 }
 
-- 
1.7.10.4



---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=115076

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About