r52790 - in /branches/upstream/libpoe-test-loops-perl/current: ./ lib/POE/Test/ lib/POE/Test/Loops/
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Mon Feb 15 15:09:50 UTC 2010
Author: jawnsy-guest
Date: Mon Feb 15 15:09:33 2010
New Revision: 52790
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=52790
Log:
[svn-upgrade] Integrating new upstream version, libpoe-test-loops-perl (1.033)
Added:
branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_rt54319_bazerka_followtail.pm
Modified:
branches/upstream/libpoe-test-loops-perl/current/CHANGES
branches/upstream/libpoe-test-loops-perl/current/MANIFEST
branches/upstream/libpoe-test-loops-perl/current/META.yml
branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops.pm
branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/ses_nfa.pm
branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_leolo_wheel_run.pm
branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_steinert_signal_integrity.pm
Modified: branches/upstream/libpoe-test-loops-perl/current/CHANGES
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-test-loops-perl/current/CHANGES?rev=52790&op=diff
==============================================================================
--- branches/upstream/libpoe-test-loops-perl/current/CHANGES (original)
+++ branches/upstream/libpoe-test-loops-perl/current/CHANGES Mon Feb 15 15:09:33 2010
@@ -1,3 +1,54 @@
+=====================================
+2010-02-15T06:28:11.163679Z ptl-1_033
+=====================================
+
+ 2010-02-15 06:27:00 (r2812) by rcaputo
+ poe-test-loops/lib/POE/Test/Loops.pm M
+
+ Bump for yet another release.
+
+ 2010-02-15 01:05:37 (r2811) by rcaputo
+ poe-test-loops/lib/POE/Test/Loops/z_rt54319_bazerka_followtail.pm M
+
+ Make Bazerka's regression test a little more forgiving about elapsed
+ run time.
+
+ 2010-02-14 23:55:56 (r2810) by rcaputo
+ poe-test-loops/lib/POE/Test/Loops/z_leolo_wheel_run.pm M
+
+ Skip pty tests if IO::Pty isn't available. Also some style fixes.
+
+ 2010-02-14 23:55:18 (r2809) by rcaputo
+ poe-test-loops/lib/POE/Test/Loops/z_rt54319_bazerka_followtail.pm M
+
+ Make the test a little more forgiving for slower systems, such as
+ virtualized Windows systems and other forms of emulation.
+
+=====================================
+2010-02-14T21:38:46.364786Z ptl-1_032
+=====================================
+
+ 2010-02-14 02:44:47 (r2797) by rcaputo
+ poe-test-loops/MANIFEST M;
+ poe-test-loops/lib/POE/Test/Loops/z_rt54319_bazerka_followtail.pm A;
+ poe-test-loops/lib/POE/Test/Loops.pm M
+
+ Add a test case from rt.cpan.org #54319. Verify Po::Wh::FollowTail
+ actually tails files. Thanks to Bazerka on irc.perl.org for
+ submitting the basis of this test case.
+
+ 2010-01-02 02:57:35 (r2773) by rcaputo
+ poe-test-loops/lib/POE/Test/Loops/z_leolo_wheel_run.pm M;
+ poe-test-loops/lib/POE/Test/Loops/ses_nfa.pm M;
+ poe-test-loops/lib/POE/Test/Loops/z_steinert_signal_integrity.pm M
+
+ Try to resolve some CPAN indexer issues.
+
+ Eliminate a $VERSION string being used to test a version (not define
+ one). Eliminate a package statement used to define a constant (not a
+ class). Change a test package name to avoid indexer conflict with
+ another distribution.
+
=====================================
2010-01-01T08:57:09.665997Z ptl-1_031
=====================================
@@ -455,20 +506,6 @@
Remove some warnings.
-=====================================
-2009-01-30T07:11:18.435237Z ptl-1_003
-=====================================
-
- 2009-01-30 07:04:44 (r2411) by rcaputo
- poe-test-loops/lib/POE/Test/Loops/wheel_run.pm M;
- poe-test-loops/lib/POE/Test/Loops.pm M;
- poe-test-loops/bin/poe-gen-tests M
-
- Apply Tony Cook's suggestion to use environment variables to skip
- problematic tests. Event loops which have these problems can bypass
- tests which are known to fail. Also fixed a documentation omission
- based on his comments in IRC.
-
==============
End of Excerpt
==============
Modified: branches/upstream/libpoe-test-loops-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-test-loops-perl/current/MANIFEST?rev=52790&op=diff
==============================================================================
--- branches/upstream/libpoe-test-loops-perl/current/MANIFEST (original)
+++ branches/upstream/libpoe-test-loops-perl/current/MANIFEST Mon Feb 15 15:09:33 2010
@@ -1,4 +1,3 @@
-# $Id: MANIFEST 2691 2009-09-16 15:11:30Z rcaputo $
CHANGES
MANIFEST
Makefile.PL
@@ -36,6 +35,7 @@
lib/POE/Test/Loops/z_merijn_sigchld_system.pm
lib/POE/Test/Loops/z_rt39872_sigchld.pm
lib/POE/Test/Loops/z_rt39872_sigchld_stop.pm
+lib/POE/Test/Loops/z_rt54319_bazerka_followtail.pm
lib/POE/Test/Loops/z_steinert_signal_integrity.pm
t/01_no_tests.t
META.yml Module meta-data (added by MakeMaker)
Modified: branches/upstream/libpoe-test-loops-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-test-loops-perl/current/META.yml?rev=52790&op=diff
==============================================================================
--- branches/upstream/libpoe-test-loops-perl/current/META.yml (original)
+++ branches/upstream/libpoe-test-loops-perl/current/META.yml Mon Feb 15 15:09:33 2010
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: POE-Test-Loops
-version: 1.031
+version: 1.033
abstract: POE::Loop test suite
author:
- Rocco Caputo <rcaputo at cpan.org>
Modified: branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops.pm?rev=52790&op=diff
==============================================================================
--- branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops.pm (original)
+++ branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops.pm Mon Feb 15 15:09:33 2010
@@ -1,4 +1,4 @@
-# $Id: Loops.pm 2769 2010-01-01 08:53:54Z rcaputo $
+# $Id: Loops.pm 2812 2010-02-15 06:27:00Z rcaputo $
package POE::Test::Loops;
@@ -6,8 +6,8 @@
use vars qw($VERSION);
use vars qw($VERSION $REVISION);
-$VERSION = '1.031'; # NOTE - Should be #.### (three decimal places)
-$REVISION = do {my($r)=(q$Revision: 2769 $=~/(\d+)/);sprintf"0.%04d",$r};
+$VERSION = '1.033'; # NOTE - Should be #.### (three decimal places)
+$REVISION = do {my($r)=(q$Revision: 2812 $=~/(\d+)/);sprintf"0.%04d",$r};
use File::Spec;
use File::Path;
Modified: branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/ses_nfa.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/ses_nfa.pm?rev=52790&op=diff
==============================================================================
--- branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/ses_nfa.pm (original)
+++ branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/ses_nfa.pm Mon Feb 15 15:09:33 2010
@@ -18,7 +18,7 @@
use POE qw(NFA);
my $NEW_POE;
BEGIN {
- if (eval "$POE::VERSION" <= 1.003) {
+ if (eval("\$POE::VER" . "SION") <= 1.003) { # Pesky CPAN indexer.
$NEW_POE = 0;
plan tests => 28;
} else {
Modified: branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_leolo_wheel_run.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_leolo_wheel_run.pm?rev=52790&op=diff
==============================================================================
--- branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_leolo_wheel_run.pm (original)
+++ branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_leolo_wheel_run.pm Mon Feb 15 15:09:33 2010
@@ -19,18 +19,21 @@
SKIP: {
skip("The underlying event loop has trouble with ptys on $^O", 6)
- if $^O eq "darwin" and (
- exists $INC{"POE/Loop/IO_Poll.pm"} or
- exists $INC{"POE/Loop/Event.pm"} or
- $ENV{POE_LOOP_USES_POLL}
- ) and not $ENV{POE_DANTIC};
+ if $^O eq "darwin" and (
+ exists $INC{"POE/Loop/IO_Poll.pm"} or
+ exists $INC{"POE/Loop/Event.pm"} or
+ $ENV{POE_LOOP_USES_POLL}
+ ) and not $ENV{POE_DANTIC};
- Worker->spawn( 'pty' );
- Worker->spawn( 'pty-pipe' );
+ eval "use IO::Pty";
+ skip("IO::Pty is not available; skipping pty tests", 6) if $@;
+
+ PoeTestWorker->spawn( 'pty' );
+ PoeTestWorker->spawn( 'pty-pipe' );
}
-Worker->spawn( 'socketpair' );
-Worker->spawn( 'inet' );
+PoeTestWorker->spawn( 'socketpair' );
+PoeTestWorker->spawn( 'inet' );
pass( "Start" );
@@ -40,7 +43,7 @@
#############################################################################
-package Worker;
+package PoeTestWorker;
use strict;
use warnings;
@@ -52,85 +55,86 @@
sub seen
{
- my( $heap, $what ) = @_;
- $heap->{seen}{$what}++;
- DEBUG and diag "$$: seen $what\n";
- if( 3==keys %{$heap->{seen}} ) {
- delete $heap->{wheel};
- $poe_kernel->alarm_remove( delete $heap->{tid} ) if $heap->{tid};
- }
+ my( $heap, $what ) = @_;
+ $heap->{seen}{$what}++;
+ DEBUG and diag "$$: seen $what\n";
+ if( 3==keys %{$heap->{seen}} ) {
+ delete $heap->{wheel};
+ $poe_kernel->alarm_remove( delete $heap->{tid} ) if $heap->{tid};
+ }
}
sub spawn
{
- my( $package, $conduit ) = @_;
- POE::Session->create(
- args => [ $conduit ],
- inline_states => {
- _start => sub {
- my( $heap, $kernel, $conduit ) = @_[ HEAP, KERNEL, ARG0 ];
- $heap->{conduit} = $conduit;
- $heap->{seen} = {};
- $kernel->sig_child( TERM => 'TERM' );
+ my( $package, $conduit ) = @_;
+ POE::Session->create(
+ args => [ $conduit ],
+ inline_states => {
+ _start => sub {
+ my( $heap, $kernel, $conduit ) = @_[ HEAP, KERNEL, ARG0 ];
+ $heap->{conduit} = $conduit;
+ $heap->{seen} = {};
+ $kernel->sig_child( TERM => 'TERM' );
- $heap->{wheel} = POE::Wheel::Run->new(
- StderrEvent => ( $conduit eq 'pty' ? undef()
- : 'stderr' ),
- StdoutEvent => 'stdout',
-# ErrorEvent => 'error',
- CloseEvent => 'closeE',
- Conduit => $conduit,
- Program => sub {
- print "hello\n";
- sleep 1;
- print "hello world" x 1024, "\n";
- print "done\n";
- }
- );
- $kernel->sig_child( $heap->{wheel}->PID, 'CHLD' );
- $heap->{tid} = $kernel->delay_set( timeout => 600 );
- },
- _stop => sub {
- my( $heap, $kernel ) = @_[ HEAP, KERNEL ];
- ## This is the money shot
- foreach my $need ( qw( done close CHLD ) ) {
- is( $heap->{seen}{$need}, 1, "$heap->{conduit}: $need" );
- }
- },
- timeout => sub {
- my( $heap, $kernel ) = @_[ HEAP, KERNEL ];
- $poe_kernel->alarm_remove( delete $heap->{tid} ) if $heap->{tid};
- delete $heap->{wheel};
- delete $heap->{tid};
- },
- TERM => sub {
- my( $heap, $kernel ) = @_[ HEAP, KERNEL ];
- $poe_kernel->alarm_remove( delete $heap->{tid} ) if $heap->{tid};
- delete $heap->{wheel};
- $kernel->sig_handled;
- },
- closeE => sub {
- my( $heap, $kernel ) = @_[ HEAP, KERNEL ];
- seen( $heap, 'close' );
- },
- CHLD => sub {
- my( $heap, $kernel ) = @_[ HEAP, KERNEL ];
- seen( $heap, 'CHLD' );
- $kernel->sig_handled;
- },
- stdout => sub {
- my( $heap, $kernel, $line, $wid ) = @_[ HEAP, KERNEL, ARG0..$#_ ];
- seen( $heap, 'done' ) if $line eq 'done';
- },
- stderr => sub {
- my( $heap, $kernel, $line, $wid ) = @_[ HEAP, KERNEL, ARG0..$#_ ];
- warn "ERROR [$$]: $line\n";
- seen( $heap, 'error' );
- $poe_kernel->alarm_remove( delete $heap->{tid} ) if $heap->{tid};
- },
+ $heap->{wheel} = POE::Wheel::Run->new(
+ StderrEvent => (
+ $conduit eq 'pty' ? undef() : 'stderr'
+ ),
+ StdoutEvent => 'stdout',
+ #ErrorEvent => 'error',
+ CloseEvent => 'closeE',
+ Conduit => $conduit,
+ Program => sub {
+ print "hello\n";
+ sleep 1;
+ print "hello world" x 1024, "\n";
+ print "done\n";
+ }
+ );
+ $kernel->sig_child( $heap->{wheel}->PID, 'CHLD' );
+ $heap->{tid} = $kernel->delay_set( timeout => 600 );
+ },
+ _stop => sub {
+ my( $heap, $kernel ) = @_[ HEAP, KERNEL ];
+ ## This is the money shot
+ foreach my $need ( qw( done close CHLD ) ) {
+ is( $heap->{seen}{$need}, 1, "$heap->{conduit}: $need" );
}
- );
+ },
+ timeout => sub {
+ my( $heap, $kernel ) = @_[ HEAP, KERNEL ];
+ $poe_kernel->alarm_remove( delete $heap->{tid} ) if $heap->{tid};
+ delete $heap->{wheel};
+ delete $heap->{tid};
+ },
+ TERM => sub {
+ my( $heap, $kernel ) = @_[ HEAP, KERNEL ];
+ $poe_kernel->alarm_remove( delete $heap->{tid} ) if $heap->{tid};
+ delete $heap->{wheel};
+ $kernel->sig_handled;
+ },
+ closeE => sub {
+ my( $heap, $kernel ) = @_[ HEAP, KERNEL ];
+ seen( $heap, 'close' );
+ },
+ CHLD => sub {
+ my( $heap, $kernel ) = @_[ HEAP, KERNEL ];
+ seen( $heap, 'CHLD' );
+ $kernel->sig_handled;
+ },
+ stdout => sub {
+ my( $heap, $kernel, $line, $wid ) = @_[ HEAP, KERNEL, ARG0..$#_ ];
+ seen( $heap, 'done' ) if $line eq 'done';
+ },
+ stderr => sub {
+ my( $heap, $kernel, $line, $wid ) = @_[ HEAP, KERNEL, ARG0..$#_ ];
+ warn "ERROR [$$]: $line\n";
+ seen( $heap, 'error' );
+ $poe_kernel->alarm_remove( delete $heap->{tid} ) if $heap->{tid};
+ },
+ }
+ );
}
1;
Added: branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_rt54319_bazerka_followtail.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_rt54319_bazerka_followtail.pm?rev=52790&op=file
==============================================================================
--- branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_rt54319_bazerka_followtail.pm (added)
+++ branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_rt54319_bazerka_followtail.pm Mon Feb 15 15:09:33 2010
@@ -1,0 +1,61 @@
+#! /usr/bin/env perl
+# vim: ts=2 sw=2 expandtab
+
+# Verify that POE::Wheel::FollowTail does indeed follow a file's tail.
+
+use strict;
+use warnings;
+
+use IO::Handle;
+use POE qw(Wheel::FollowTail);
+
+use constant TESTS => 10;
+use Test::More;
+
+my $tailfile = "/tmp/powh-followtail-test-$$";
+my $write_count = 0;
+my $write_fh;
+
+open $write_fh, ">", $tailfile or plan(
+ skip_all => "can't write to temporary file $tailfile: $!"
+);
+$write_fh->autoflush(1);
+
+plan tests => 10;
+
+POE::Session->create(
+ inline_states => {
+ _start => sub {
+ $_[KERNEL]->yield("on_tick");
+ },
+ on_tick => sub {
+ print $write_fh ++$write_count, " ", time(), "\n";
+ $_[KERNEL]->delay("on_tick" => 1) if $write_count < TESTS;
+ },
+ }
+);
+
+POE::Session->create(
+ inline_states => {
+ _start => sub {
+ $_[HEAP]{tailor} = POE::Wheel::FollowTail->new(
+ Filename => $tailfile,
+ InputEvent => "got_log_line",
+ PollInterval => 3,
+ );
+ $_[KERNEL]->delay(timeout => 15);
+ },
+ got_log_line => sub {
+ my ($write, $time) = split /\s+/, $_[ARG0];
+ my $elapsed = time() - $time;
+ ok($elapsed <= 3, "response time <=3 seconds ($elapsed)");
+ delete $_[HEAP]{tailor} if $write >= TESTS;
+ },
+ timeout => sub {
+ delete $_[HEAP]{tailor};
+ },
+ }
+);
+
+POE::Kernel->run();
+unlink $tailfile;
Modified: branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_steinert_signal_integrity.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_steinert_signal_integrity.pm?rev=52790&op=diff
==============================================================================
--- branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_steinert_signal_integrity.pm (original)
+++ branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_steinert_signal_integrity.pm Mon Feb 15 15:09:33 2010
@@ -12,8 +12,9 @@
sub POE::Kernel::ASSERT_DEFAULT () { 1 }
BEGIN {
- package POE::Kernel;
- use constant TRACE_DEFAULT => exists($INC{'Devel/Cover.pm'});
+ eval "sub POE::Kernel::TRACE_DEFAULT () { 1 }" if (
+ exists $INC{'Devel/Cover.pm'}
+ );
}
use POE;
More information about the Pkg-perl-cvs-commits
mailing list