1package Test2::Require::RealFork;
2use strict;
3use warnings;
4
5use base 'Test2::Require';
6
7our $VERSION = '0.000162';
8
9use Test2::Util qw/CAN_REALLY_FORK/;
10
11sub skip {
12    return undef if CAN_REALLY_FORK;
13    return "This test requires a perl capable of true forking.";
14}
15
161;
17
18__END__
19
20=pod
21
22=encoding UTF-8
23
24=head1 NAME
25
26Test2::Require::RealFork - Skip a test file unless the system supports true
27forking
28
29=head1 DESCRIPTION
30
31It is fairly common to write tests that need to fork. Not all systems support
32forking. This library does the hard work of checking if forking is supported on
33the current system. If forking is not supported then this will skip all tests
34and exit true.
35
36=head1 SYNOPSIS
37
38    use Test2::Require::RealFork;
39
40    ... Code that forks ...
41
42=head1 SEE ALSO
43
44=over 4
45
46=item L<Test2::Require::Canfork>
47
48Similar to this module, but will allow fork emulation.
49
50=item L<Test2::Require::CanThread>
51
52Skip the test file if the system does not support threads.
53
54=back
55
56=head1 SOURCE
57
58The source code repository for Test2-Suite can be found at
59F<https://github.com/Test-More/Test2-Suite/>.
60
61=head1 MAINTAINERS
62
63=over 4
64
65=item Chad Granum E<lt>exodist@cpan.orgE<gt>
66
67=back
68
69=head1 AUTHORS
70
71=over 4
72
73=item Chad Granum E<lt>exodist@cpan.orgE<gt>
74
75=back
76
77=head1 COPYRIGHT
78
79Copyright 2018 Chad Granum E<lt>exodist@cpan.orgE<gt>.
80
81This program is free software; you can redistribute it and/or
82modify it under the same terms as Perl itself.
83
84See F<http://dev.perl.org/licenses/>
85
86=cut
87