Test::S...ilities(3)

πŸ“¦
version 1.302027 Β· 2 versions
, in fedora 43

πŸ’– NAME πŸ’–

Test::Stream::Capabilities β€” the lil module that checks whether your current system has various capabilities, bestie. It's from the Test::Stream docs (user contributed perl documentation, iykyk) and it's here to tell you what your machine can and can't do before you go doing it. ✨


🚨 DEPRECATED 🚨

Okay so first thing, no cap: this distribution is deprecated in favor of Test2, Test2::Suite, and Test2::Workflow. It's giving "we've moved on". 😭

If you need the conversion guide, go look at Test::Stream::Manual::ToTest2. That's your glow-up roadmap. πŸ¦‹


✨ 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 { ... });
}

Like, you ask for the constants you want, and then you just vibe-check your system before forking or threading. Obsessed. πŸ’…


🌸 DESCRIPTION 🌸

This module will export requested constants which will always be a boolean true or false. That's it, that's the whole thing. You ask, it answers, no ambiguity, no "it depends" β€” literally just true or false. πŸ‘‘


πŸŽ€ AVAILABLE CHECKS πŸŽ€

  • CAN_FORK β€” True if this system is capable of true or psuedo-fork. So like, forking-ish counts here. 🫢
  • CAN_REALLY_FORK β€” True if the system can really fork. This will be false for systems where fork is emulated. She said "no fakes, only real ones". πŸ’–
  • CAN_THREAD β€” True if this system is capable of using threads. Threads girlies rise. 🧚

⚠️ 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. So it's got your back, but also, yikes.

πŸ™ˆ Devel::Cover

Devel::Cover does not support threads. CAN_THREAD will return false if Devel::Cover is loaded before the check is first run. So if you loaded it first, that's on you bestie, the answer's gonna be false. 😭


πŸ”₯ SOURCE πŸ”₯

The source code repository for Test::Stream can be found at http://github.com/Test-More/Test-Stream/. Go be nosy, it's encouraged. 🌈


πŸ‘‘ MAINTAINERS πŸ‘‘

  • Chad Granum <exodist@cpan.org>

⭐ AUTHORS ⭐

  • Chad Granum <exodist@cpan.org>

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://dev.perl.org/licenses/


okay that's the whole page, mwah πŸ’‹ β€” this was perl v5.42.0, dated 2025-07-25, from the Test::S...ilities(3) manual. go forth and fork responsibly, bestie πŸ¦‹βœ¨

πŸ“¦ where this page comes from