GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TEST::STREAM::WORKFLOW::RUNNER (3)

.ds Aq ’

NAME

Test::Stream::Workflow::Runner - Simple runner for workflows.

CONTENTS

DEPRECATED

<B>This distribution is deprecatedB> in favor of Test2, Test2::Suite, and Test2::Workflow.

See Test::Stream::Manual::ToTest2 for a conversion guide.

EXPERIMENTAL CODE WARNING

This module is still EXPERIMENTAL. Test-Stream is now stable, but this particular module is still experimental. You are still free to use this module, 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.

DESCRIPTION

This is a basic class for running workflows. This class is intended to be subclasses for more fancy/feature rich workflows.

SYNOPSIS

    SUBCLASS



    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



    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.

If there is no meta instance for the calling class then import is a no-op.

$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.
$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.

    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.
$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).
$runner->run_task($task) This simply calls $task->run(). It is mainly here for subclasses to override.

SOURCE

The source code repository for Test::Stream can be found at http://github.com/Test-More/Test-Stream/.

MAINTAINERS

Chad Granum <exodist@cpan.org>

AUTHORS

Chad Granum <exodist@cpan.org>

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

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TEST::STREAM::WORKFLOW::RUNNER (3) 2016-02-05

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.