Acme-Sort-Sleep
view release on metacpan or search on metacpan
local/lib/perl5/IO/Async/LoopTests.pm view on Meta::CPAN
# You may distribute under the terms of either the GNU General Public License
# or the Artistic License (the same terms as Perl itself)
#
# (C) Paul Evans, 2009-2015 -- leonerd@leonerd.org.uk
package IO::Async::LoopTests;
use strict;
use warnings;
use Exporter 'import';
our @EXPORT = qw(
run_tests
);
use Test::More;
use Test::Fatal;
use Test::Refcount;
use IO::Async::Test qw();
use IO::Async::OS;
use IO::File;
use Fcntl qw( SEEK_SET );
use POSIX qw( SIGTERM );
use Socket qw( sockaddr_family AF_UNIX );
use Time::HiRes qw( time );
our $VERSION = '0.70';
# Abstract Units of Time
use constant AUT => $ENV{TEST_QUICK_TIMERS} ? 0.1 : 1;
# The loop under test. We keep it in a single lexical here, so we can use
# is_oneref tests in the individual test suite functions
my $loop;
END { undef $loop }
=head1 NAME
C<IO::Async::LoopTests> - acceptance testing for L<IO::Async::Loop> subclasses
=head1 SYNOPSIS
use IO::Async::LoopTests;
run_tests( 'IO::Async::Loop::Shiney', 'io' );
=head1 DESCRIPTION
This module contains a collection of test functions for running acceptance
tests on L<IO::Async::Loop> subclasses. It is provided as a facility for
authors of such subclasses to ensure that the code conforms to the Loop API
required by L<IO::Async>.
=head1 TIMING
Certain tests require the use of timers or timed delays. Normally these are
counted in units of seconds. By setting the environment variable
C<TEST_QUICK_TIMERS> to some true value, these timers run 10 times quicker,
being measured in units of 0.1 seconds instead. This value may be useful when
running the tests interactively, to avoid them taking too long. The slower
timers are preferred on automated smoke-testing machines, to help guard
against false negatives reported simply because of scheduling delays or high
system load while testing.
TEST_QUICK_TIMERS=1 ./Build test
=cut
=head1 FUNCTIONS
=cut
=head2 run_tests
run_tests( $class, @tests )
( run in 0.861 second using v1.01-cache-2.11-cpan-54e63673c56 )