On Wed Mar 24 06:39:06 2010, KARASIK wrote:
Show quoted text> Uhh, the bug was apparently due to change of precedence in perlop...
> May I ask you to apply the following patch and see if it works for you?
> (it does for me)
>
> Thanks!
>
>
> --- /home/dk/src/perl/POE-Loop-Prima/lib/POE/Loop/Prima.pm
> 2009-12-22 13:06:22.048486213 +0100
> +++ /usr/local/share/perl/5.10.0/POE/Loop/Prima.pm 2010-03-24
> 11:36:33.262063619 +0100
> @@ -125,9 +125,9 @@
> # Maintain filehandle watchers.
>
> my %mask = (
> - MODE_RD => [ fe::Read, 'onRead' ],
> - MODE_WR => [ fe::Write, 'onWrite' ],
> - MODE_EX => [ fe::Exception, 'onException' ],
> + MODE_RD , [ fe::Read, 'onRead' ],
> + MODE_WR , [ fe::Write, 'onWrite' ],
> + MODE_EX , [ fe::Exception, 'onException' ],
> );
>
Hello, thanks for the patch! It now passes my "simple" test but hangs
in POE::Test::Loops' testsuite - comp_tcp.t
Attached is a patch against PoLo-Prima 1.01 that adds PTL support and
also includes your patch ;)
Thanks again!
--
~Apocalypse
diff -urbd POE-Loop-Prima-1.01/lib/POE/Loop/Prima.pm POE-Loop-Prima-1.01-myver/lib/POE/Loop/Prima.pm
--- POE-Loop-Prima-1.01/lib/POE/Loop/Prima.pm 2007-09-23 01:07:50.000000000 -0700
+++ POE-Loop-Prima-1.01-myver/lib/POE/Loop/Prima.pm 2010-03-24 09:36:04.000000000 -0700
@@ -125,9 +125,9 @@
# Maintain filehandle watchers.
my %mask = (
- MODE_RD => [ fe::Read, 'onRead' ],
- MODE_WR => [ fe::Write, 'onWrite' ],
- MODE_EX => [ fe::Exception, 'onException' ],
+ MODE_RD , [ fe::Read, 'onRead' ],
+ MODE_WR , [ fe::Write, 'onWrite' ],
+ MODE_EX , [ fe::Exception, 'onException' ],
);
sub _loop_select_callback
@@ -255,3 +255,11 @@
Dmitry Karasik, E<lt>dmitry@karasik.eu.orgE<gt>.
=cut
+
+=begin poe_tests
+
+sub skip_tests {
+ return "Prima tests require the Prima module" if do { eval "use Prima"; $@ };
+}
+
+=end poe_tests
diff -urbd POE-Loop-Prima-1.01/Makefile.PL POE-Loop-Prima-1.01-myver/Makefile.PL
--- POE-Loop-Prima-1.01/Makefile.PL 2007-09-23 01:07:50.000000000 -0700
+++ POE-Loop-Prima-1.01-myver/Makefile.PL 2010-03-24 09:43:52.000000000 -0700
@@ -1,9 +1,69 @@
# $Id: Makefile.PL,v 1.2 2007/09/23 08:07:50 dk Exp $
use ExtUtils::MakeMaker;
+use POE::Test::Loops;
+
+# Switch to default behavior if STDIN isn't a tty.
+
+unless (-t STDIN) {
+ warn(
+ "\n",
+ "=============================================\n\n",
+ "STDIN is not a terminal. Assuming --default.\n\n",
+ "=============================================\n\n",
+ );
+ push @ARGV, "--default";
+}
+
+# Remind the user she can use --default.
+
+unless (grep /^--default$/, @ARGV) {
+ warn(
+ "\n",
+ "=============================================\n\n",
+ "Prompts may be bypassed by running:\n",
+ " $^X $0 --default\n\n",
+ "=============================================\n\n",
+ );
+}
+
+# Should we skip the network tests?
+
+my $prompt = (
+ "Some of POE::Loop::Prima's tests require a\n" .
+ "functional network. You can skip these network\n" .
+ "tests if you'd like.\n\n" .
+ "Would you like to skip the network tests?"
+);
+
+my $ret = "n";
+if (grep /^--default$/, @ARGV) {
+ print $prompt, " [$ret] $ret\n\n";
+}
+else {
+ $ret = prompt($prompt, "n");
+}
+
+my $marker = 'run_network_tests';
+unlink $marker;
+unless ($ret =~ /^Y$/i) {
+ open(TOUCH,"+>$marker") and close TOUCH;
+}
+
+POE::Test::Loops::generate( 't', [ 'POE::Loop::Prima' ], 0 );
+
WriteMakefile(
NAME => 'POE::Loop::Prima',
AUTHOR => 'Dmitry Karasik <dmitry@karasik.eu.org>',
ABSTRACT_FROM => 'lib/POE/Loop/Prima.pm',
VERSION_FROM => 'lib/POE/Loop/Prima.pm',
PREREQ_PM => { POE => 0, Prima => 0 },
+
+ # Add support for POE::Test::Loops
+ test => { TESTS => 't/*.t t/poe_loop_prima/*.t' },
+ clean => { FILES => 't/poe_loop_prima/*.t t/poe_loop_prima ' . $marker },
+ META_MERGE => {
+ build_requires => {
+ 'POE::Test::Loops' => '1.034',
+ },
+ },
);