NAME
Test::Stream::Capabilities - Check if the current system has various capabilities.
EXPERIMENTAL CODE WARNING
This is an experimental release! Test-Stream, and all its components are still in an experimental phase. This dist has been released to cpan in order to allow testers and early adopters the chance to write experimental new tools with it, or to add experimental support for it into old tools.
PLEASE DO NOT COMPLETELY CONVERT OLD TOOLS YET. This experimental release is very likely to see a lot of code churn. API's may break at any time. Test-Stream should NOT be depended on by any toolchain level tools until the experimental phase is over.
SYNOPSIS
use Test::Stream::Capabilities qw/CAN_FORK CAN_REALLY_FORK CAN_THREAD/;
if (CAN_FORK) {
my $pid = fork();
...
}
if (CAN_REALLY_FORK) {
my $pid = fork();
...
}
if (CAN_THREAD) {
threads->new(sub { ... });
}
DESCRIPTION
This module will export requested constants which will always be a boolean true or false.
AVAILABLE CHECKS
- CAN_FORK
-
True if this system is capable of true or psuedo-fork.
- CAN_REALLY_FORK
-
True if the system can really fork. This will be false for systems where fork is emulated.
- CAN_THREAD
-
True if this system is capable of using threads.
NOTES && CAVEATS
- 5.10.0
-
Perl 5.10.0 has a bug when compiled with newer gcc versions. This bug causes a segfault whenever a new thread is launched. Test::Stream will attempt to detect this, and note that the system is not capable of forking when it is detected.
- Devel::Cover
-
Devel::Cover does not support threads. CHECK_THREADS will return false if Devel::Cover is loaded before the check is first run.
SOURCE
The source code repository for Test::Stream can be found at http://github.com/Test-More/Test-Stream/.
MAINTAINERS
AUTHORS
COPYRIGHT
Copyright 2015 Chad Granum <exodist7@gmail.com>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html