Test::S...:Runner(3)

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

πŸ’– Test::S...:Runner β€” the manual page, but make it make sense ✨

okay bestie, welcome to Test::Stream::Workflow::Runner (perl, section 3, user-contributed perl documentation, iykyk) 🫢 this is the little class that runs your workflows. she's simple. she's a base class. she's literally built to be subclassed. let's go πŸ’…


🚨 DEPRECATED 🚨

ngl this one hurts a little. This distribution is deprecated in favor of Test2, Test2::Suite, and Test2::Workflow. πŸ’€

if you need to move over, there's a conversion guide waiting for you at Test::Stream::Manual::ToTest2. go read it, bestie, it's giving glow-up 🌈


⚠️ EXPERIMENTAL CODE WARNING ⚠️

"This module is still EXPERIMENTAL"

Test-Stream is now stable, but this particular module is still out here in its experimental era. you are still free to use it, but you have been warned that it may change in backwords incompatible ways. This message will be removed from this modules POD once it is considered stable. πŸ‘‘

so like... use her, love her, but don't be shocked if she changes outfits on you πŸ™ˆ


🌸 DESCRIPTION 🌸

This is a basic class for running workflows. fr fr it's basic on purpose β€” this class is intended to be subclassed for more fancy/feature rich workflows. main character energy for your subclass, supporting role for this one πŸ’…βœ¨


πŸŽ€ SYNOPSIS πŸŽ€

SUBCLASS

okay so here's how you make your own runner. copy this vibe:

package My::Runner;
use strict;
use warnings;

use parent 'Test::Stream::Workflow::Runner';

sub instance {
    my $class = shift;
    return $class->new(@_);
}

sub subtest {
    my $self = shift;
    my ($unit) = @_;
    ...
    return $bool
}

sub verify_meta {
    my $self = shift;
    my ($unit) = @_;
    my $meta = $unit->meta || return;
    warn "the 'foo' meta attribute is not supported" if $meta->{foo};
    ...
}

sub run_task {
    my $self = shift;
    my ($task) = @_;
    ...
    $task->run();
    ...
}

USE SUBCLASS

and then you actually use it, like this πŸ¦‹

use Test::Stream qw/... Spec/;

use My::Runner; # Sets the runner for the Spec plugin.

...

πŸ’œ METHODS πŸ’œ

CLASS METHODS

  • $class->import()
  • $class->import(@instance_args) β€” The import method checks the calling class to see if it has an Test::Stream::Workflow::Meta instance, if it does then it sets the runner. The runner that is set is the result of calling "$class->instance(@instance_args)". The instance_args are optional. and if there is no meta instance for the calling class then import is a no-op. no drama, no notes, it just does nothing 🫢
  • $bool = $class->subtests($unit) β€” This determines if the units should be run as subtest or flat. The base class always returns true for this. This is a hook that allows you to override the default behavior. your call, bestie πŸ’…
  • $runner = $class->instance()
  • $runner = $class->instance(@args) β€” This is a hook allowing you to construct an instance of your runner. The base class simply returns the class name as it does not need to be instansiated. If your runner needs to maintain state then this can return a blessed instance. state-havers rise up πŸ”₯

CLASS AND/OR OBJECT METHODS

These are made to work on the class itself, but should also work just fine on a blessed instance if your subclass needs to be instantiated. flexible queen 🌈

  • $runner->verify_meta($unit) β€” This method reads the "$unit->meta" hash and warns about any unrecognised keys. Your subclass should override this if it wants to add support for any meta-keys. πŸ‘€
  • $runner->run(unit => $unit, args => $arg)
  • $runner->run(unit => $unit, args => $arg, no_final => $bool) β€” Tell the runner to run a unit with the specified args. The args are optional. The "no_final" arg is optional, it should be used on support units that should not produce final results (or be a subtest of their own). yes this matters, no cap πŸ’–
  • $runner->run_task($task) β€” This simply calls "$task->run()". It is mainly here for subclasses to override. short king of a method, we love him πŸ’œ

πŸ”₯ SOURCE πŸ”₯

The source code repository for Test::Stream can be found at http://github.com/Test-More/Test-Stream/. come hang out πŸŽ€


πŸ‘‘ 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/


and that's the whole page, bestie πŸ’… she was documented with perl v5.42.0 on 2025-07-25, so like, a little vintage, a little iconic, and honestly still slaying. mwah πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from