Algorithm-EventsPerSecond
view release on metacpan or search on metacpan
#!perl
use 5.006;
use strict;
use warnings;
use Test::More;
use lib 't/lib';
use AEPS_TestSuite;
diag 'backend: '
. Algorithm::EventsPerSecond->backend
. ( Algorithm::EventsPerSecond->simd ? ' (' . Algorithm::EventsPerSecond->simd . ')' : '' );
AEPS_TestSuite::run_suite();
done_testing();
t/pure-perl.t view on Meta::CPAN
#!perl
use 5.006;
use strict;
use warnings;
use Test::More;
# force the pure Perl backend before the module is loaded
BEGIN { $ENV{ALGORITHM_EVENTSPERSECOND_PP} = 1 }
use lib 't/lib';
use AEPS_TestSuite;
is( Algorithm::EventsPerSecond->backend, 'PP', 'ALGORITHM_EVENTSPERSECOND_PP forces the pure Perl backend' );
is( Algorithm::EventsPerSecond->simd, undef, 'simd is undef on the pure Perl backend' );
AEPS_TestSuite::run_suite();
done_testing();
t/sukkal-lifecycle.t view on Meta::CPAN
use 5.006;
use strict;
use warnings;
use Test::More;
BEGIN {
plan skip_all => 'unix domain sockets and fork required'
if $^O eq 'MSWin32';
}
use lib 't/lib';
use File::Temp qw(tempdir);
use Time::HiRes qw(sleep);
use Algorithm::EventsPerSecond::Sukkal;
use Sukkal_TestUtil qw(spawn_daemon connect_daemon read_line req req_multi stop_daemon);
alarm 120; # watchdog: a hung daemon must fail the test, not the harness
sub new_dies {
my ( $desc, $err_re, %args ) = @_;
ok( !eval { Algorithm::EventsPerSecond::Sukkal->new(%args); 1 }, $desc );
t/sukkal-protocol.t view on Meta::CPAN
use 5.006;
use strict;
use warnings;
use Test::More;
BEGIN {
plan skip_all => 'unix domain sockets and fork required'
if $^O eq 'MSWin32';
}
use lib 't/lib';
use Time::HiRes qw(sleep);
use Sukkal_TestUtil qw(spawn_daemon connect_daemon read_line req req_multi stop_daemon);
$SIG{PIPE} = 'IGNORE';
alarm 120; # watchdog: a hung daemon must fail the test, not the harness
my $d = spawn_daemon( window => 5, max_key_length => 10 );
my $sock = connect_daemon($d);
#
#!perl
use 5.006;
use strict;
use warnings;
use Test::More;
use lib 't/lib';
use AEPS_TestSuite;
if ( Algorithm::EventsPerSecond->backend ne 'XS' ) {
plan skip_all => 'XS backend not available; pure Perl fallback covered by t/02';
}
my $simd = Algorithm::EventsPerSecond->simd;
ok( defined $simd && $simd =~ /^(AVX2|SSE4\.2|scalar)$/, "simd reports the compiled flavor ($simd)" );
# large counts survive the round trip through the int64_t buffers
( run in 0.524 second using v1.01-cache-2.11-cpan-995e09ba956 )