Test2::Event::Generic - Generic event type. |
Test2::Event::Generic - Generic event type.
This is a generic event that lets you customize all fields in the event API. This is useful if you have need for a custom event that does not make sense as a published reusable event subclass.
use Test2::API qw/context/;
sub send_custom_fail { my $ctx = shift;
$ctx->send_event('Generic', causes_fail => 1, summary => 'The sky is falling');
$ctx->release; }
send_custom_fail();
facet_data($data)
Test2::Event->facet_data
will be called to produce facets from the other
data.
callback($hub)
set_causes_fail($bool)
causes_fail
attribute. This defaults to 0
.
set_diagnostics($bool)
diagnostics
attribute. This defaults to 0
.
set_global($bool_or_undef)
diagnostics
attribute. This defaults to an empty list which is
undef in scalar context.
set_increments_count($bool)
increments_count
attribute. This defaults to 0
.
set_no_display($bool)
no_display
attribute. This defaults to 0
.
($count, $directive, $reason)
. $count
must be defined, the others may be
undef, or may not exist at all.
set_sets_plan(\@plan)
set_summary($summary_or_undef)
'Test2::Event::Generic'
. You can set it to any value. Setting this to
undef
will reset it to the default.
set_terminate($int_or_undef)
terminate
attribute. This defaults to undef in scalar
context, or an empty list in list context. Setting this to undef will clear it
completely. This must be set to a positive integer (0 or larger).
The source code repository for Test2 can be found at http://github.com/Test-More/test-more/.
Copyright 2019 Chad Granum <exodist@cpan.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://dev.perl.org/licenses/
Test2::Event::Generic - Generic event type. |