Dave Rolsky > Test-Class-Moose-0.55-TRIAL > Test::Class::Moose::Runner

Download:
Test-Class-Moose-0.55-TRIAL.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.55   Source   Latest Release: Test-Class-Moose-0.58

NAME ^

Test::Class::Moose::Runner - Runner for Test::Class::Moose tests

VERSION ^

version 0.55

SYNOPSIS ^

 use Test::Class::Moose::Load 't/lib';
 use Test::Class::Moose::Runner;
 Test::Class::Moose::Runner->new->runtests;

DESCRIPTION ^

This class is responsible for running tests. Internally, most of the work is done by either a Test::Class::Moose::Executor::Sequential or Test::Class::Moose::Executor::Parallel object.

LOADING TESTS ^

We strongly recommend using the Test::Class::Moose::Load driver for your test suite. Simply point it at the directory or directories containing your test classes:

 use Test::Class::Moose::Load 't/lib';
 use Test::Class::Moose::Runner;
 Test::Class::Moose::Runner->new->runtests;

By running your Test::Class::Moose tests with a single driver script like this, all classes are loaded once and this can be a significant performance boost. This does mean a global state will be shared, so keep this in mind.

CONSTRUCTOR ATTRIBUTES ^

METHODS ^

In addition to the new method, this class provides several additional public methods

$runner->runtests

This method runs your tests. It accepts no arguments.

$runner->test_configuration

This returns a Test::Class::Moose::Config for the runner.

Most of the attributes passed to the runner are actually available in a Test::Class::Moose::Config rather than the runner itself. This may change in a future release, in which case this method will simply return the runner itself for backwards compatibility.

PARALLEL RUNNING ^

Running tests in parallel requires you to have Parallel::ForkManager installed. This is not a prereq of this distro so you will need to install manually.

To run tests in parallel, simply pass a value greater than 1 for the jobs parameter when creating a runner object:

  Test::Class::Moose::Runner->new( jobs => 4 )->runtests;

Your test classes will be run in parallel in separate child processes. Test classes are parallelized on a per instance basis. This means that each child process constructs a single instance of a test class and runs all of that classes methods.

If you are using parameterized test instances (see the Test::Class::Moose docs for details) then the same class may have instances running in different child processes.

If any of the methods in a class are marked with the noparallel tag, then that class will be not be run in a child process. All test classes which can't be run in parallel are run sequentially after all parallelizable classes have run.

AUTHOR ^

Curtis "Ovid" Poe <ovid@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2014 by Curtis "Ovid" Poe.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: