use strict;
use warnings;
-our $VERSION = '1.302113';
+our $VERSION = '1.302133';
use Test2::API::Instance;
use Test2::API qw{
test2_init_done
test2_ipc
+ test2_has_ipc
test2_ipc_enable_polling
test2_pid
test2_stack
our @EXPORT_OK = qw/cull/;
BEGIN { require Exporter; our @ISA = qw(Exporter) }
+sub unimport { Test2::API::test2_ipc_disable() }
+
sub import {
- goto &Exporter::import unless test2_init_done();
+ goto &Exporter::import if test2_has_ipc || !test2_init_done();
+ confess "IPC is disabled" if Test2::API::test2_ipc_disabled();
confess "Cannot add IPC in a child process (" . test2_pid() . " vs $$)" if test2_pid() != $$;
confess "Cannot add IPC in a child thread (" . test2_tid() . " vs " . get_tid() . ")" if test2_tid() != get_tid();
import this module after API initialization it will attempt to retrofit IPC
onto the existing hubs.
+=head2 DISABLING IT
+
+You can use C<no Test2::IPC;> to disable IPC for good. You can also use the
+T2_NO_IPC env var.
+
=head1 EXPORTS
All exports are optional.
=head1 COPYRIGHT
-Copyright 2017 Chad Granum E<lt>exodist@cpan.orgE<gt>.
+Copyright 2018 Chad Granum E<lt>exodist@cpan.orgE<gt>.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.