1Test::Stream::CapabilitUiseesr(3C)ontributed Perl DocumeTnetsatt:i:oSntream::Capabilities(3)
2
3
4
6 Test::Stream::Capabilities - Check if the current system has various
7 capabilities.
8
10 This distribution is deprecated in favor of Test2, Test2::Suite, and
11 Test2::Workflow.
12
13 See Test::Stream::Manual::ToTest2 for a conversion guide.
14
16 use Test::Stream::Capabilities qw/CAN_FORK CAN_REALLY_FORK CAN_THREAD/;
17
18 if (CAN_FORK) {
19 my $pid = fork();
20 ...
21 }
22
23 if (CAN_REALLY_FORK) {
24 my $pid = fork();
25 ...
26 }
27
28 if (CAN_THREAD) {
29 threads->new(sub { ... });
30 }
31
33 This module will export requested constants which will always be a
34 boolean true or false.
35
37 CAN_FORK
38 True if this system is capable of true or psuedo-fork.
39
40 CAN_REALLY_FORK
41 True if the system can really fork. This will be false for systems
42 where fork is emulated.
43
44 CAN_THREAD
45 True if this system is capable of using threads.
46
48 5.10.0
49 Perl 5.10.0 has a bug when compiled with newer gcc versions. This
50 bug causes a segfault whenever a new thread is launched.
51 Test::Stream will attempt to detect this, and note that the system
52 is not capable of forking when it is detected.
53
54 Devel::Cover
55 Devel::Cover does not support threads. CAN_THREAD will return false
56 if Devel::Cover is loaded before the check is first run.
57
59 The source code repository for Test::Stream can be found at
60 http://github.com/Test-More/Test-Stream/.
61
63 Chad Granum <exodist@cpan.org>
64
66 Chad Granum <exodist@cpan.org>
67
69 Copyright 2015 Chad Granum <exodist7@gmail.com>.
70
71 This program is free software; you can redistribute it and/or modify it
72 under the same terms as Perl itself.
73
74 See http://dev.perl.org/licenses/
75
76
77
78perl v5.36.0 2023-01-20 Test::Stream::Capabilities(3)