blib/lib/DBIO/PostgreSQL/EV/TestHarness.pm

filter: Statementstmt 90.9% 20 / 22 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod n/a totaltotal 88.8% 24 / 27 CC 1 SCAR 1.8
CC
1
Cov
91%
_tick_loop
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« blib/lib/DBIO/PostgreSQL/EV/Future.pm ↑ Summary blib/lib/DBIO/PostgreSQL/EV.pm »
1 package DBIO::PostgreSQL::EV::TestHarness;
2 # ABSTRACT: Reusable live-PostgreSQL harness for EV async on_connect-replay tests
3  
4 45 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 45 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 45 our $VERSION = '0.900007';
8  
9 45 ▶use base 'DBIO::Test::AsyncHarness';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11  
12 45 __PACKAGE__->harness_env_prefix('DBIO_TEST_PG');
13 45 __PACKAGE__->harness_async_mode('ev');
14 45 __PACKAGE__->harness_required_modules([qw( EV EV::Pg )]);
15 45 __PACKAGE__->harness_schema_class('DBIO::PostgreSQL::EV::TestHarness::_Schema');
16  
17 # The default schema class used when the caller supplies none: an ordinary sync
18 # PostgreSQL schema. It declares its driver (core ADR 0067) with the
19 # PostgreSQL component, which pins DBIO::PostgreSQL::Storage, the storage that
20 # registers the 'ev' async mode; no result sources are needed because the
21 # harness exercises connection-level SQL, not the ORM. A schema_class the
22 # caller supplies declares its own driver.
23 #
24 # It loads no component of this distribution: DBIO::PostgreSQL::EV is the
25 # distribution's overview module -- POD, no methods, no connection() hook --
26 # and a schema reaches the ev mode without it (the distribution's SYNOPSIS
27 # declares the driver with the -pg shortcut and loads no component at all;
28 # t/45-synopsis-plain-schema-live.t runs it).
29 # dbio-mysql-ev's harness loads 'MySQL::EV' as well; the two differ there. That
30 # DBIO::PostgreSQL::EV, loaded as a component, takes no part in resolution is
31 # proven offline -- t/00-load.t's ADR 0032 storage-layer contract,
32 # t/02-access-broker.t's storage_type guard, t/27's registry check.
33 {
34 45 package DBIO::PostgreSQL::EV::TestHarness::_Schema;
35 45 ▶ use base 'DBIO::Schema';
Subroutine BEGIN: called CC=1 SCAR=0.0
36 45 __PACKAGE__->load_components('PostgreSQL');
37 }
38  
39  
40 0 ▶sub _tick_loop {
Subroutine _tick_loop: not called CC=1 SCAR=6.9
41 0 require EV;
42 0 return EV::run(EV::RUN_ONCE());
43 }
44  
45 45 1;
46  
47 __END__
« blib/lib/DBIO/PostgreSQL/EV/Future.pm ↑ Summary blib/lib/DBIO/PostgreSQL/EV.pm »