our
$VERSION
=
'1.302210'
;
sub
init {
my
$self
=
shift
;
$self
->SUPER::init();
if
(
my
$format
=
$self
->
format
) {
my
$hide
=
$format
->can(
'hide_buffered'
) ?
$format
->hide_buffered : 1;
$self
->
format
(
undef
)
if
$hide
;
}
}
sub
inherit {
my
$self
=
shift
;
my
(
$from
,
%params
) =
@_
;
if
(
my
$ls
=
$from
->{+_LISTENERS}) {
push
@{
$self
->{+_LISTENERS}} =>
grep
{
$_
->{inherit} }
@$ls
;
}
if
(
my
$pfs
=
$from
->{+_PRE_FILTERS}) {
push
@{
$self
->{+_PRE_FILTERS}} =>
grep
{
$_
->{inherit} }
@$pfs
;
}
if
(
my
$fs
=
$from
->{+_FILTERS}) {
push
@{
$self
->{+_FILTERS}} =>
grep
{
$_
->{inherit} }
@$fs
;
}
}
sub
send
{
my
$self
=
shift
;
my
(
$e
) =
@_
;
if
(
my
$ast
=
$self
->ast) {
if
($$ !=
$ast
->pid || get_tid !=
$ast
->tid) {
if
(
my
$plan
=
$e
->facet_data->{plan}) {
unless
(
$plan
->{skip}) {
my
$trace
=
$e
->facet_data->{trace};
bless
(
$trace
,
'Test2::EventFacet::Trace'
);
$trace
->alert(
"A plan should not be set inside an async-subtest (did you call done_testing()?)"
);
return
;
}
}
}
}
return
$self
->SUPER::
send
(
$e
);
}
1;