Browse files

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.
  • Loading branch information...
1 parent 4c7eb9e commit 2120b37828ba1f938b71619041035b6d98b17a8b @rcaputo committed Jan 30, 2009
View
20 poe-test-loops/bin/poe-gen-tests
@@ -39,7 +39,7 @@ poe-gen-tests - generate standard POE tests for third-party modules
--loop Glib \
--loop Kqueue \
--loop Event::Lib \
- --loop POE::XS::Loop::Poll
+ --loop POE::XS::Loop::Poll
=head1 DESCRIPTION
@@ -69,6 +69,7 @@ generates the following test files:
t/loops/select/all_errors.t
t/loops/select/comp_tcp.t
t/loops/select/comp_tcp_concurrent.t
+ t/loops/select/connect_errors.t
t/loops/select/k_alarms.t
t/loops/select/k_aliases.t
t/loops/select/k_detach.t
@@ -93,8 +94,8 @@ generates the following test files:
The --loop parameter is either a POE::Loop::... class name or the
event loop class that will complete the POE::Loop::... package name.
- poe-gen-tests --dirbase t/loops --loop Event::Lib
- poe-gen-tests --dirbase t/loops --loop POE::Loop::Event_Lib
+ 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
@@ -301,6 +302,19 @@ free to do it some other way.
print "\n";
+=head1 Skipping Other Tests
+
+POE's loop tests will enable or disable tests based on the event
+loop's capabilities. Distributions and event loops may set these
+variables to signal which tests are okay to run.
+
+=head2 POE_LOOP_USES_POLL
+
+Some platforms do not support poll() on certain kinds of filehandles.
+Event loops that use poll() should set this environment variable to a
+true value. It will cause the tests to skip this troublesome
+combination.
+
=head1 SEE ALSO
L<POE::Test::Loops> and L<POE::Loop>.
View
2 poe-test-loops/lib/POE/Test/Loops.pm
@@ -6,7 +6,7 @@ use strict;
use vars qw($VERSION);
use vars qw($VERSION $REVISION);
-$VERSION = '1.002'; # NOTE - Should be #.### (three decimal places)
+$VERSION = '1.003'; # NOTE - Should be #.### (three decimal places)
$REVISION = do {my($r)=(q$Revision$=~/(\d+)/);sprintf"0.%04d",$r};
use File::Spec;
View
3 poe-test-loops/lib/POE/Test/Loops/wheel_run.pm
@@ -546,7 +546,8 @@ for my $chld_program (@chld_programs) {
skip "$chld_name/pty: The underlying event loop has trouble with ptys on $^O", 2*STD_TEST_COUNT
if $^O eq "darwin" and (
exists $INC{"POE/Loop/IO_Poll.pm"} or
- exists $INC{"POE/Loop/Event.pm"}
+ exists $INC{"POE/Loop/Event.pm"} or
+ $ENV{POE_LOOP_USES_POLL}
);
create_test_session(

0 comments on commit 2120b37

Please sign in to comment.