r55412 - in /branches/upstream/libpoe-test-loops-perl/current: ./ bin/ lib/POE/Test/ lib/POE/Test/Loops/
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Sat Apr 3 19:27:31 UTC 2010
Author: jawnsy-guest
Date: Sat Apr 3 19:27:19 2010
New Revision: 55412
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=55412
Log:
[svn-upgrade] Integrating new upstream version, libpoe-test-loops-perl (1.034)
Added:
branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/00_info.pm
branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_rt53302_fh_watchers.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/README
branches/upstream/libpoe-test-loops-perl/current/bin/poe-gen-tests
branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops.pm
branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/wheel_readline.pm
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
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-test-loops-perl/current/CHANGES?rev=55412&op=diff
==============================================================================
--- branches/upstream/libpoe-test-loops-perl/current/CHANGES (original)
+++ branches/upstream/libpoe-test-loops-perl/current/CHANGES Sat Apr 3 19:27:19 2010
@@ -1,3 +1,81 @@
+=====================================
+2010-04-03T18:15:36.151833Z ptl-1_034
+=====================================
+
+ 2010-04-03 17:46:46 (r2854) by rcaputo
+ poe-test-loops/lib/POE/Test/Loops.pm M
+
+ Bump PTL revision for release.
+
+ 2010-03-24 06:52:46 (r2852) by apocal
+ poe M; polo-gtk/Makefile.PL M; polo-tk M; polo-event M; poe-test-loops
+ M; polo-gtk M
+
+ Set svn:ignore for: META.yml CHANGES run_network_tests PoLo-Gtk
+ forgot to clean run_network_tests
+
+ 2010-03-23 17:27:32 (r2849) by rcaputo
+ poe-test-loops/MANIFEST M;
+ poe-test-loops/lib/POE/Test/Loops/z_rt53302_fh_watchers.pm R;
+ poe-test-loops/lib/POE/Test/Loops/z_rt53302_fh_watchers_slow.pm D
+
+ Replace z_rt53302_fh_watchers.pm with z_rt53302_fh_watchers_slow.pm.
+ The non-slow one was broken since its client shuts down without
+ waiting for the server's response.
+
+ 2010-03-22 06:00:17 (r2846) by rcaputo
+ poe-test-loops/lib/POE/Test/Loops.pm M;
+ poe-test-loops/bin/poe-gen-tests M
+
+ Support legal =for and =begin POD syntax for skip_tests(), in
+ addition to the previous =for/=cut syntax that caused skip_tests() to
+ appear in everyone's perldoc. Document the change. Deprecate the bad
+ syntax, which won't be a terrible burden since everyone probably
+ wanted to migrate away from it anyway.
+
+ 2010-03-22 02:54:39 (r2845) by apocal
+ poe-test-loops/lib/POE/Test/Loops.pm M;
+ poe-test-loops/bin/poe-gen-tests M
+
+ Add optional one-line =for poe_tests syntax to hide it from POD
+ formatters.
+
+ Add example from POE::Loop::Glib that uses the new syntax.
+
+ 2010-03-11 06:57:11 (r2839) by apocal
+ poe-test-loops/MANIFEST M; poe-test-loops/lib/POE/Test/Loops/00_info.pm
+ A
+
+ Added the 00_info test for better debugging
+
+ 2010-03-11 05:28:23 (r2838) by apocal
+ poe-test-loops/MANIFEST M;
+ poe-test-loops/lib/POE/Test/Loops/z_rt53302_fh_watchers.pm A;
+ poe-test-loops/lib/POE/Test/Loops/z_rt53302_fh_watchers_slow.pm A
+
+ Add new tcp connection test for RT#53302
+
+ 2010-03-10 19:14:25 (r2836) by rcaputo
+ poe-test-loops/bin/poe-gen-tests M
+
+ Update the skip_tests() examples, and explain what's going on in
+ each.
+
+ 2010-03-09 07:59:40 (r2831) by apocal
+ poe-test-loops/lib/POE/Test/Loops/z_rt54319_bazerka_followtail.pm M
+
+ Fix the followtail test to use File::Temp, thanks to
+ http://cpantesters.org/cpan/report/6877011 and others like it
+
+ 2010-03-09 07:20:16 (r2830) by apocal
+ poe/lib/POE/Wheel/ReadLine.pm M;
+ poe-test-loops/lib/POE/Test/Loops/wheel_readline.pm M
+
+ After a lot of hacking/digging Cygwin with a TERM=dumb does not work
+ with POE::Wheel::ReadLine. This fix skips the test, and makes
+ Wheel::ReadLine die if it detects this situation. Added some docs for
+ our Cygwin users :)
+
=====================================
2010-02-15T06:28:11.163679Z ptl-1_033
=====================================
@@ -396,116 +474,6 @@
should all try these tests. Except the one commented out of the
MANIFEST, as it has a tendency to segfault for people.
-=====================================
-2009-03-08T00:34:03.909445Z ptl-1_005
-=====================================
-
- 2009-03-08 00:33:21 (r2497) by rcaputo
- poe-test-loops/Makefile.PL M;
- poe-test-loops/lib/POE/Test/Loops/ses_nfa.pm M;
- poe-test-loops/lib/POE/Test/Loops.pm M
-
- Remove version.pm dependency.
-
-=====================================
-2009-03-07T18:54:28.797464Z ptl-1_004
-=====================================
-
- 2009-03-07 18:52:37 (r2493) by rcaputo
- poe-test-loops/lib/POE/Test/Loops.pm M
-
- Time for an official release.
-
- 2009-03-02 00:06:17 (r2487) by rcaputo
- poe-test-loops/lib/POE/Test/Loops.pm M
-
- New test release.
-
- 2009-03-01 22:26:44 (r2486) by apocal
- poe-test-loops/Makefile.PL M;
- poe-test-loops/lib/POE/Test/Loops/ses_nfa.pm M
-
- Remove the specific dependency on version 0.74, and pray that the
- user has a recent enough version
-
- 2009-03-01 13:31:26 (r2477) by apocal
- poe-test-loops/lib/POE/Test/Loops/wheel_tail.pm M
-
- I was overzealous, this test works in Strawberry Perl, not
- ActiveState...
-
- 2009-03-01 12:53:59 (r2476) by apocal
- poe-test-loops/lib/POE/Test/Loops/connect_errors.pm M;
- poe-test-loops/lib/POE/Test/Loops/wheel_tail.pm M
-
- more tweaks to get the tests to SKIP on buggy MSWin32 perls :(
-
- 2009-03-01 08:21:04 (r2475) by apocal
- poe-test-loops/lib/POE/Test/Loops/wheel_accept.pm M
-
- tweak the test so it passes on MSWin32+ActiveState 5.6.1
-
- 2009-02-25 08:09:16 (r2468) by rcaputo
- poe-test-loops/lib/POE/Test/Loops.pm M
-
- Time for a new release.
-
- 2009-02-23 12:29:33 (r2463) by lotr
- poe-test-loops/Makefile.PL M;
- poe-test-loops/lib/POE/Test/Loops/ses_nfa.pm M
-
- use version.pm so our version comparison is more robust and supports
- developer releases too
-
- 2009-02-22 19:37:04 (r2459) by rcaputo
- poe-test-loops/lib/POE/Test/Loops.pm M
-
- Time for a new DEVELOPER release.
-
- 2009-02-22 19:25:46 (r2458) by rcaputo
- poe-test-loops/lib/POE/Test/Loops.pm M
-
- Time for a new release.
-
- 2009-02-17 12:27:29 (r2453) by lotr
- poe-test-loops/lib/POE/Test/Loops/ses_nfa.pm M
-
- remove spurious warns
-
- 2009-02-17 11:20:27 (r2452) by lotr
- poe-test-loops/lib/POE/Test/Loops/wheel_readline.pm M
-
- match up missing brace
-
- 2009-02-17 11:18:59 (r2451) by lotr
- poe-test-loops/lib/POE/Test/Loops/ses_nfa.pm M
-
- only run the object/package state tests if we have a new enough POE
-
- 2009-02-17 08:03:49 (r2450) by rcaputo
- poe/lib/POE/Wheel/ReadLine.pm M;
- poe-test-loops/lib/POE/Test/Loops/wheel_readline.pm M
-
- Resolve rt.cpan.org #38974, reported by Jari Bonte. If TERM is
- misset, we will skip the POE::Wheel::ReadLine test rather than fail.
-
- 2009-02-16 11:23:16 (r2444) by apocal
- poe-test-loops/lib/POE/Test/Loops/sbk_signal_init.pm M
-
- skip test because of broken alarm() on MSWin32 with perl5.6
-
- 2009-02-16 10:34:12 (r2440) by lotr
- poe-test-loops/lib/POE/Test/Loops/ses_nfa.pm M
-
- use object and package_states in NFA tests to make sure it works
-
- 2009-02-10 09:05:42 (r2426) by rcaputo
- poe-test-loops/lib/POE/Test/Loops/wheel_readwrite.pm M;
- poe-test-loops/lib/POE/Test/Loops/ses_session.pm M;
- poe-test-loops/lib/POE/Test/Loops/ses_nfa.pm M
-
- Remove some warnings.
-
==============
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=55412&op=diff
==============================================================================
--- branches/upstream/libpoe-test-loops-perl/current/MANIFEST (original)
+++ branches/upstream/libpoe-test-loops-perl/current/MANIFEST Sat Apr 3 19:27:19 2010
@@ -5,6 +5,7 @@
bin/poe-gen-tests
lib/POE/Test/DondeEstan.pm
lib/POE/Test/Loops.pm
+lib/POE/Test/Loops/00_info.pm
lib/POE/Test/Loops/all_errors.pm
lib/POE/Test/Loops/comp_tcp.pm
lib/POE/Test/Loops/comp_tcp_concurrent.pm
@@ -37,5 +38,6 @@
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
+lib/POE/Test/Loops/z_rt53302_fh_watchers.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=55412&op=diff
==============================================================================
--- branches/upstream/libpoe-test-loops-perl/current/META.yml (original)
+++ branches/upstream/libpoe-test-loops-perl/current/META.yml Sat Apr 3 19:27:19 2010
@@ -1,25 +1,14 @@
--- #YAML:1.0
-name: POE-Test-Loops
-version: 1.033
-abstract: POE::Loop test suite
-author:
+name: POE-Test-Loops
+version: 1.034
+abstract: POE::Loop test suite
+license: perl
+author:
- Rocco Caputo <rcaputo at cpan.org>
-license: perl
-distribution_type: module
-configure_requires:
- ExtUtils::MakeMaker: 0
-build_requires:
- ExtUtils::MakeMaker: 0
-requires:
- Test::More: 0
-resources:
- license: http://dev.perl.org/licenses/
- repository: https://poe.svn.sourceforge.net/svnroot/poe/trunk/poe-test-loops
-no_index:
- directory:
- - t
- - inc
-generated_by: ExtUtils::MakeMaker version 6.54
+generated_by: ExtUtils::MakeMaker version 6.42
+distribution_type: module
+requires:
+ Test::More: 0
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ url: http://module-build.sourceforge.net/META-spec-v1.3.html
+ version: 1.3
Modified: branches/upstream/libpoe-test-loops-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-test-loops-perl/current/README?rev=55412&op=diff
==============================================================================
--- branches/upstream/libpoe-test-loops-perl/current/README (original)
+++ branches/upstream/libpoe-test-loops-perl/current/README Sat Apr 3 19:27:19 2010
@@ -66,10 +66,14 @@
poeâgenâtests ââdirbase t/loops ââloop Event::Lib
poeâgenâtests ââdirbase t/loops ââloop POE::Loop::Event_Lib
- poeâgenâtests looks for a "=for poe_tests" section within the POE::Loop
- class being tested. If defined, this section should include a single
- function, _s_k_i_p___t_e_s_t_s_(_), that determines whether any given test should
- be skipped.
+ poeâgenâtests looks for a "=for poe_tests" or "=begin poe_tests"
+ section within the POE::Loop class being tested. If defined, this
+ section should include a single function, _s_k_i_p___t_e_s_t_s_(_), that determines
+ whether any given test should be skipped.
+
+ Please see perlpod for syntax for "=for" and "=begin". Also see
+ PODDITIES for notable differences between POE::Test::Loopâs POD support
+ and the standard.
_s_k_i_p___t_e_s_t_s_(_) is called with one parameter, the base name of the test
about to be executed. It returns false if the test should run, or a
@@ -86,40 +90,46 @@
EExxaammppllee ppooee__tteessttss DDiirreeccttiivveess
- From POE::Loop::Event
-
- =for poe_tests
-
- sub skip_tests {
+ POE::Loop::Event checks whether the Event module exists and can be
+ loaded, then whether specific tests can run under specific operating
+ systems.
+
+ =for poe_tests
+ sub skip_tests {
+ return "Event tests require the Event module" if (
+ do { eval "use Event"; $@ }
+ );
my $test_name = shift;
if ($test_name eq "k_signals_rerun" and $^O eq "MSWin32") {
- return "This test crashes Perl when run with Event on $^O";
- }
- return "Event tests require the Event module" if (
- do { eval "use Event"; $@ }
- );
- }
-
- =cut
-
- From POE::Loop::Gtk
-
- =for poe_tests
-
- sub skip_tests {
+ return "This test crashes Perl when run with Tk on $^O";
+ }
+ if ($test_name eq "wheel_readline" and $^O eq "darwin") {
+ return "Event skips two of its own tests for the same reason";
+ }
+ }
+
+ POE::Loop::Gtk checks whether DISPLAY is set, which implies that X is
+ running. It then checks whether Gtk is available, loadable, and safely
+ initializable before skipping specific tests.
+
+ =for poe_tests
+ sub skip_tests {
+ my $test_name = shift;
return "Gtk needs a DISPLAY (set one today, okay?)" unless (
defined $ENV{DISPLAY} and length $ENV{DISPLAY}
);
return "Gtk tests require the Gtk module" if do { eval "use Gtk"; $@ };
+ return "Gtk init failed. Is DISPLAY valid?" unless defined Gtkâ>init_check;
+ if ($test_name eq "z_rt39872_sigchld_stop") {
+ return "Gdk crashes";
+ }
return;
}
- =cut
-
- From POE::Loop::IO_Poll
-
- =for poe_tests
-
+ POE::Loop::IO_Poll checks for system compatibility before verifying
+ that IO::Poll is available and loadable.
+
+ =for poe_tests
sub skip_tests {
return "IO::Poll is not 100% compatible with $^O" if $^O eq "MSWin32";
return "IO::Poll tests require the IO::Poll module" if (
@@ -127,20 +137,16 @@
);
}
- =cut
-
- From POE::Loop::Select
-
- =for poe_tests
-
+ POE::Loop::Select has no specific requirements.
+
+ =for poe_tests
sub skip_tests { return }
- =cut
-
- From POE::Loop::Tk
-
- =for poe_tests
-
+ POE::Loop::Tk needs an X display (except on Windows). Tk is not safe
+ for _f_o_r_k_(_), so skip tests that require forking. And finally, check
+ whether the Tk module is available, loadable, and runnable.
+
+ =for poe_tests
sub skip_tests {
return "Tk needs a DISPLAY (set one today, okay?)" unless (
(defined $ENV{DISPLAY} and length $ENV{DISPLAY}) or $^O eq "MSWin32"
@@ -150,10 +156,14 @@
return "This test crashes Perl when run with Tk on $^O";
}
return "Tk tests require the Tk module" if do { eval "use Tk"; $@ };
+ my $m = eval { Tk::MainWindowâ>new() };
+ if ($@) {
+ my $why = $@;
+ $why =~ s/ at .*//;
+ return "Tk couldn't be initialized: $why";
+ }
return;
}
-
- =cut
IINNSSTTAALLLL SSCCRRIIPPTT IINNTTEEGGRRAATTIIOONN
The POE::Loop tests started out as part of the POE distribution. All
@@ -279,8 +289,44 @@
true value. It will cause the tests to skip this troublesome
combination.
+ PPOODDDDIITTIIEESS
+
+ Previous versions of POE::Test::Loops documented "=for poe_tests"
+ sections terminated by =cut and containing blank lines. This is
+ incorrect POD syntax, and itâs the reason the _s_k_i_p___t_e_s_t_s_(_) functions
+ showed up in perldoc and on search.cpan.org. The following syntax is
+ wrong and should not have been used. Iâm so sorry.
+
+ =for poe_tests
+
+ sub skip_tests { ... }
+
+ =cut
+
+ The proper syntax is to terminate "=for poe_tests" with a blank line:
+
+ =for poe_tests
+ sub skip_tests {
+ ...
+ }
+
+ Multiâline tests containing blank lines can be specified using PODâs
+ "=begin poe_tests" terminated by "=end poe_tests".
+
+ =begin poe_tests
+
+ sub skip_tests {
+ ...
+ }
+
+ =end poe_tests
+
+ All three syntaxes above are supported as of POE::Test::Loops version
+ 1.034. The incorrect =for syntax is deprecated and will be removed in
+ some future release.
+
SSEEEE AALLSSOO
- POE::Test::Loops and POE::Loop.
+ POE::Test::Loops, POE::Loop, perlpod.
BBUUGG TTRRAACCKKEERR
@@ -307,4 +353,4 @@
-perl v5.10.0 2009â07â27 POEâGENâTESTS(1)
+perl v5.10.0 2010â03â22 POEâGENâTESTS(1)
Modified: branches/upstream/libpoe-test-loops-perl/current/bin/poe-gen-tests
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-test-loops-perl/current/bin/poe-gen-tests?rev=55412&op=diff
==============================================================================
--- branches/upstream/libpoe-test-loops-perl/current/bin/poe-gen-tests (original)
+++ branches/upstream/libpoe-test-loops-perl/current/bin/poe-gen-tests Sat Apr 3 19:27:19 2010
@@ -97,10 +97,14 @@
poe-gen-tests --dirbase t/loops --loop Event::Lib
poe-gen-tests --dirbase t/loops --loop POE::Loop::Event_Lib
-poe-gen-tests looks for a "=for poe_tests" section within the
-POE::Loop class being tested. If defined, this section should include
-a single function, skip_tests(), that determines whether any given
-test should be skipped.
+poe-gen-tests looks for a "=for poe_tests" or "=begin poe_tests"
+section within the POE::Loop class being tested. If defined, this
+section should include a single function, skip_tests(), that
+determines whether any given test should be skipped.
+
+Please see L<perlpod> for syntax for "=for" and "=begin". Also see
+L<PODDITIES> for notable differences between POE::Test::Loop's POD
+support and the standard.
skip_tests() is called with one parameter, the base name of the test
about to be executed. It returns false if the test should run, or a
@@ -117,40 +121,46 @@
=head2 Example poe_tests Directives
-From POE::Loop::Event
-
- =for poe_tests
-
- sub skip_tests {
+POE::Loop::Event checks whether the Event module exists and can be
+loaded, then whether specific tests can run under specific operating
+systems.
+
+ =for poe_tests
+ sub skip_tests {
+ return "Event tests require the Event module" if (
+ do { eval "use Event"; $@ }
+ );
my $test_name = shift;
if ($test_name eq "k_signals_rerun" and $^O eq "MSWin32") {
- return "This test crashes Perl when run with Event on $^O";
- }
- return "Event tests require the Event module" if (
- do { eval "use Event"; $@ }
- );
- }
-
- =cut
-
-From POE::Loop::Gtk
-
- =for poe_tests
-
- sub skip_tests {
+ return "This test crashes Perl when run with Tk on $^O";
+ }
+ if ($test_name eq "wheel_readline" and $^O eq "darwin") {
+ return "Event skips two of its own tests for the same reason";
+ }
+ }
+
+POE::Loop::Gtk checks whether DISPLAY is set, which implies that X is
+running. It then checks whether Gtk is available, loadable, and
+safely initializable before skipping specific tests.
+
+ =for poe_tests
+ sub skip_tests {
+ my $test_name = shift;
return "Gtk needs a DISPLAY (set one today, okay?)" unless (
defined $ENV{DISPLAY} and length $ENV{DISPLAY}
);
return "Gtk tests require the Gtk module" if do { eval "use Gtk"; $@ };
+ return "Gtk init failed. Is DISPLAY valid?" unless defined Gtk->init_check;
+ if ($test_name eq "z_rt39872_sigchld_stop") {
+ return "Gdk crashes";
+ }
return;
}
- =cut
-
-From POE::Loop::IO_Poll
-
- =for poe_tests
-
+POE::Loop::IO_Poll checks for system compatibility before verifying
+that IO::Poll is available and loadable.
+
+ =for poe_tests
sub skip_tests {
return "IO::Poll is not 100% compatible with $^O" if $^O eq "MSWin32";
return "IO::Poll tests require the IO::Poll module" if (
@@ -158,20 +168,16 @@
);
}
- =cut
-
-From POE::Loop::Select
-
- =for poe_tests
-
+POE::Loop::Select has no specific requirements.
+
+ =for poe_tests
sub skip_tests { return }
- =cut
-
-From POE::Loop::Tk
-
- =for poe_tests
-
+POE::Loop::Tk needs an X display (except on Windows). Tk is not safe
+for fork(), so skip tests that require forking. And finally, check
+whether the Tk module is available, loadable, and runnable.
+
+ =for poe_tests
sub skip_tests {
return "Tk needs a DISPLAY (set one today, okay?)" unless (
(defined $ENV{DISPLAY} and length $ENV{DISPLAY}) or $^O eq "MSWin32"
@@ -181,10 +187,14 @@
return "This test crashes Perl when run with Tk on $^O";
}
return "Tk tests require the Tk module" if do { eval "use Tk"; $@ };
+ my $m = eval { Tk::MainWindow->new() };
+ if ($@) {
+ my $why = $@;
+ $why =~ s/ at .*//;
+ return "Tk couldn't be initialized: $why";
+ }
return;
}
-
- =cut
=head1 INSTALL SCRIPT INTEGRATION
@@ -315,9 +325,45 @@
true value. It will cause the tests to skip this troublesome
combination.
+=head2 PODDITIES
+
+Previous versions of POE::Test::Loops documented "=for poe_tests"
+sections terminated by =cut and containing blank lines. This is
+incorrect POD syntax, and it's the reason the skip_tests() functions
+showed up in perldoc and on search.cpan.org. The following syntax is
+wrong and should not have been used. I'm so sorry.
+
+ =for poe_tests
+
+ sub skip_tests { ... }
+
+ =cut
+
+The proper syntax is to terminate "=for poe_tests" with a blank line:
+
+ =for poe_tests
+ sub skip_tests {
+ ...
+ }
+
+Multi-line tests containing blank lines can be specified using POD's
+"=begin poe_tests" terminated by "=end poe_tests".
+
+ =begin poe_tests
+
+ sub skip_tests {
+ ...
+ }
+
+ =end poe_tests
+
+All three syntaxes above are supported as of POE::Test::Loops version
+1.034. The incorrect =for syntax is deprecated and will be removed in
+some future release.
+
=head1 SEE ALSO
-L<POE::Test::Loops> and L<POE::Loop>.
+L<POE::Test::Loops>, L<POE::Loop>, L<perlpod>.
=head2 BUG TRACKER
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=55412&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 Sat Apr 3 19:27:19 2010
@@ -1,4 +1,5 @@
-# $Id: Loops.pm 2812 2010-02-15 06:27:00Z rcaputo $
+# $Id: Loops.pm 2854 2010-04-03 17:46:46Z rcaputo $
+# vim: ts=2 sw=2 expandtab
package POE::Test::Loops;
@@ -6,12 +7,17 @@
use vars qw($VERSION);
use vars qw($VERSION $REVISION);
-$VERSION = '1.033'; # NOTE - Should be #.### (three decimal places)
-$REVISION = do {my($r)=(q$Revision: 2812 $=~/(\d+)/);sprintf"0.%04d",$r};
+$VERSION = '1.034'; # NOTE - Should be #.### (three decimal places)
+$REVISION = do {my($r)=(q$Revision: 2854 $=~/(\d+)/);sprintf"0.%04d",$r};
use File::Spec;
use File::Path;
use File::Find;
+
+use constant TEST_BLOCK_FOR_WHICH => 0x01;
+use constant TEST_BLOCK_FOR_WRONG => 0x02;
+use constant TEST_BLOCK_FOR_RIGHT => 0x04;
+use constant TEST_BLOCK_BEGIN => 0x08;
### Find the test libraries.
@@ -145,14 +151,91 @@
open SOURCE, "<$fqmn" or die $!;
while (<SOURCE>) {
- if ($in_test_block) {
- $in_test_block = 0, next if /^=cut\s*$/;
+ # Not in a test block.
+ unless ($in_test_block) {
+
+ # Proper =for syntax.
+ if (/^=for\s+poe_tests\s+(\S.*?)$/) {
+ push @test_source, $1;
+ $in_test_block = TEST_BLOCK_FOR_RIGHT;
+ next;
+ }
+
+ # Not sure which =for syntax is in use.
+ if (/^=for\s+poe_tests\s*$/) {
+ $in_test_block = TEST_BLOCK_FOR_WHICH;
+ next;
+ }
+
+ if (/^=begin\s+(poe_tests)\s*$/) {
+ $in_test_block = TEST_BLOCK_BEGIN;
+ next;
+ }
+
+ # Some random line. Do nothing.
+ next;
+ }
+
+ # Which test block format are we in?
+ if ($in_test_block & TEST_BLOCK_FOR_WHICH) {
+ # If the following line is blank, then we're probably in the
+ # wrong, multi-line kind originally documented and now
+ # deprecated.
+ if (/^\s*$/) {
+ $in_test_block = TEST_BLOCK_FOR_WRONG;
+ next;
+ }
+
+ # The following line is not blank, so it appears we're in a
+ # properly formated =for paragraph.
+ $in_test_block = TEST_BLOCK_FOR_RIGHT;
push @test_source, $_;
next;
}
- next unless /^=for\s+poe_tests\s*/;
- $in_test_block = 1;
+ # The =begin syntax ends with an =end.
+ if ($in_test_block & TEST_BLOCK_BEGIN) {
+ if (/^=end\s*poe_tests\s*$/) {
+ $in_test_block = 0;
+ next;
+ }
+
+ # Be helpful?
+ die "=cut not the proper way to end =begin poe_tests" if /^=cut\s*$/;
+
+ push @test_source, $_;
+ next;
+ }
+
+ # The proper =for syntax ends on a blank line.
+ if ($in_test_block & TEST_BLOCK_FOR_RIGHT) {
+ if (/^$/) {
+ $in_test_block = 0;
+ next;
+ }
+
+ # Be helpful?
+ die "=cut not the proper way to end =for poe_tests" if /^=cut\s*$/;
+
+ push @test_source, $_;
+ next;
+ }
+
+ # The wrong =for syntax ends on =cut.
+ if ($in_test_block & TEST_BLOCK_FOR_WRONG) {
+ if (/^=cut\s*$/) {
+ $in_test_block = 0;
+ next;
+ }
+
+ # Be helpful?
+ die "=end not the proper way to end =for poe_tests" if /^=end/;
+
+ push @test_source, $_;
+ next;
+ }
+
+ die "parser in unknown state: $in_test_block";
}
shift @test_source while @test_source and $test_source[0] =~ /^\s*$/;
Added: branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/00_info.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/00_info.pm?rev=55412&op=file
==============================================================================
--- branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/00_info.pm (added)
+++ branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/00_info.pm Sat Apr 3 19:27:19 2010
@@ -1,0 +1,36 @@
+#!/usr/bin/perl -w
+# vim: ts=2 sw=2 expandtab
+
+# This test simply dumps some debug info to the console
+
+use strict;
+
+sub POE::Kernel::ASSERT_DEFAULT () { 1 }
+
+BEGIN {
+ eval "sub POE::Kernel::TRACE_DEFAULT () { 1 }" if (
+ exists $INC{'Devel/Cover.pm'}
+ );
+}
+
+use Test::More;
+plan tests => 2;
+
+use_ok( "POE" );
+use_ok( "POE::Test::Loops" );
+
+# idea from Test::Harness, thanks!
+diag(
+ "Testing POE $POE::VERSION, ",
+ "POE::Test::Loops $POE::Test::Loops::VERSION, ",
+ "Using Loop(",
+ $POE::Kernel::poe_kernel->poe_kernel_loop(),
+ "), Perl $], ",
+ "$^X on $^O"
+);
+
+# TODO <@dngor> If it can glean the loop from the test generator, it could compare them to make sure they match.
+# This would require parsing the "=for poe_tests" block and trying to extract the loop out of it...
+
+1;
+
Modified: branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/wheel_readline.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/wheel_readline.pm?rev=55412&op=diff
==============================================================================
--- branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/wheel_readline.pm (original)
+++ branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/wheel_readline.pm Sat Apr 3 19:27:19 2010
@@ -250,9 +250,9 @@
use POE qw(Filter::Stream Wheel::ReadWrite);
eval "use POE::Wheel::ReadLine";
-if ($@ and $@ =~ /(requires a termcap|failed termcap lookup)/) {
+if ($@ and $@ =~ /(requires a termcap|failed termcap lookup|cannot run)/) {
my $error = $@;
- $error =~ s/ at \S+ line \d+.*//;
+ $error =~ s/ at \S+ line \d+.*//s;
$error =~ s/\s+/ /g;
plan skip_all => $error;
}
Added: branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_rt53302_fh_watchers.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_rt53302_fh_watchers.pm?rev=55412&op=file
==============================================================================
--- branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_rt53302_fh_watchers.pm (added)
+++ branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_rt53302_fh_watchers.pm Sat Apr 3 19:27:19 2010
@@ -1,0 +1,118 @@
+#!/usr/bin/perl -w
+# vim: ts=2 sw=2 expandtab
+
+# Rocco Caputo noticed this bug in POE::Loop::Glib v0.037.
+# LotR wanted this converted into a test in PTL so we can
+# verify the bug is gone and help other loop authors :)
+
+# TODO do we need a way to timeout the test?
+
+use strict;
+
+BEGIN {
+ unless (-f "run_network_tests") {
+ print "1..0 # Skip Network access (and permission) required to run this test\n";
+ CORE::exit();
+ }
+}
+
+sub POE::Kernel::ASSERT_DEFAULT () { 1 }
+#sub POE::Kernel::TRACE_FILES () { 1 }
+
+BEGIN {
+ eval "sub POE::Kernel::TRACE_DEFAULT () { 1 }" if (
+ exists $INC{'Devel/Cover.pm'}
+ );
+}
+
+use Test::More;
+plan tests => 8;
+
+use POE qw( Component::Server::TCP Component::Client::TCP );
+use Socket qw( sockaddr_in );
+
+my $num_clients = 5;
+
+# testing variables
+my $num_server_connects = 0;
+my $num_server_disconnects = 0;
+my $num_server_inputs = 0;
+my $num_server_flushes = 0;
+my $acceptor_port;
+
+my $num_client_connects = 0;
+my $num_client_disconnects = 0;
+my $num_client_inputs = 0;
+my $num_client_flushes = 0;
+
+# Spawn the TCP server.
+POE::Component::Server::TCP->new(
+ Alias => 'server',
+ Address => 'localhost',
+ Port => 0,
+ Started => sub {
+ $acceptor_port = (
+ sockaddr_in($_[HEAP]->{listener}->getsockname())
+ )[0];
+ },
+
+ ClientConnected => sub { $num_server_connects++ },
+
+ ClientInput => sub {
+ $num_server_inputs++;
+
+ $_[HEAP]->{client}->put( 'from server' );
+ $_[KERNEL]->yield( 'shutdown' );
+ },
+
+ ClientFlushed => sub { $num_server_flushes++ },
+
+ ClientDisconnected => sub {
+ $num_server_disconnects++;
+
+ # end the test after N clients is done
+ if ( $num_server_disconnects >= $num_clients ) {
+ $_[KERNEL]->call( 'server', 'shutdown' );
+ }
+ },
+);
+
+# spawn the client
+for ( 1 .. $num_clients ) {
+ POE::Component::Client::TCP->new(
+ RemoteAddress => 'localhost',
+ RemotePort => $acceptor_port,
+ ConnectTimeout => 2,
+
+ Connected => sub {
+ $num_client_connects++;
+
+ $_[HEAP]->{server}->put( 'from client' );
+ },
+ Disconnected => sub { $num_client_disconnects++ },
+
+ ServerInput => sub {
+ $num_client_inputs++;
+
+ $_[KERNEL]->delay( 'shutdown' => 1 );
+ },
+ ServerError => sub {},
+ ServerFlushed => sub { $num_client_flushes++ },
+ );
+}
+
+$poe_kernel->run();
+
+# Okay, make sure we processed N connections
+is( $num_server_connects, $num_clients, "Server got $num_clients client connections" );
+is( $num_server_disconnects, $num_clients, "Server got $num_clients client disconnections" );
+is( $num_server_inputs, $num_clients, "Client sent input $num_clients times" );
+is( $num_server_flushes, $num_clients, "Server flushed $num_clients lines of data" );
+
+is( $num_client_connects, $num_clients, "Client connected $num_clients times" );
+is( $num_client_disconnects, $num_clients, "Client disconnected $num_clients times" );
+is( $num_client_inputs, $num_clients, "Server sent input $num_clients times" );
+is( $num_client_flushes, $num_clients, "Client flushed $num_clients lines of data" );
+
+1;
+
Modified: 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=55412&op=diff
==============================================================================
--- branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_rt54319_bazerka_followtail.pm (original)
+++ branches/upstream/libpoe-test-loops-perl/current/lib/POE/Test/Loops/z_rt54319_bazerka_followtail.pm Sat Apr 3 19:27:19 2010
@@ -12,14 +12,15 @@
use constant TESTS => 10;
use Test::More;
-my $tailfile = "/tmp/powh-followtail-test-$$";
+use File::Temp;
+
+# Sanely generate the tempfile
+my $write_fh;
+eval { $write_fh = File::Temp->new( UNLINK => 1 ) };
+plan skip_all => "Unable to create tempfile for testing" if $@;
+
+$write_fh->autoflush(1);
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;
@@ -39,7 +40,7 @@
inline_states => {
_start => sub {
$_[HEAP]{tailor} = POE::Wheel::FollowTail->new(
- Filename => $tailfile,
+ Filename => $write_fh->filename,
InputEvent => "got_log_line",
PollInterval => 3,
);
@@ -58,4 +59,5 @@
);
POE::Kernel->run();
-unlink $tailfile;
+
+1;
More information about the Pkg-perl-cvs-commits
mailing list