Giter Site home page Giter Site logo

Comments (2)

petdance avatar petdance commented on June 11, 2024 1

Applied. Thank.s

from test-perl-critic.

marioroy avatar marioroy commented on June 11, 2024

Hi @petdance. The following resolves the issue. Also, added missing line in _test_serial.

--- Test/Perl/Critic.pm	2017-07-04 12:01:15.421579849 -0500
+++ Test/Perl/Critic.pm.fix	2017-11-21 21:30:50.478096779 -0600
@@ -92,7 +92,7 @@
     my @files = Perl::Critic::Utils::all_perl_files(@dirs_or_files);
     croak 'Nothing to critique' if not @files;

-    my $have_mce = eval {require MCE::Grep};
+    my $have_mce = eval { require MCE::Grep; MCE::Grep->import; 1 };
     return $have_mce ? _test_parallel(@files) : _test_serial(@files);
 }

@@ -109,13 +109,15 @@
       # workers. So we disable the T::B sanity checks at the end of its life.
       $TEST->no_ending(1);

-      my $okays = MCE::Grep::mce_grep { critic_ok($_) } @files;
+      my $okays = MCE::Grep->run( sub { critic_ok($_) }, @files );
       my $pass = $okays == @files;

       # To make Test::Harness happy, we must emit a test plan and a sensible exit
       # status. Usually, T::B does this for us, but we disabled the ending above.
       $pass || eval 'END { $? = 1 }'; ## no critic qw(Eval Interpolation)
-      return $TEST->done_testing(scalar @files);
+      $TEST->done_testing(scalar @files);
+
+      return $pass;
 }

 #---------------------------------------------------------------------------
@@ -126,6 +128,8 @@
   my $okays = grep {critic_ok($_)} @files;
   my $pass = $okays == @files;

+  $TEST->done_testing(scalar @files);
+
   return $pass;
 }

I tested Test-Perl-Critic without and with MCE 1.827 through 1.832.

from test-perl-critic.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.