NAME
Test::Class::Moose::Role::Executor - Common code for Runner classes
VERSION
version 0.99
DESCRIPTION
This role implements the guts of this distribution, running all of your test classes. It's public API can be wrapped by additional roles to provide extensions to the default TCM behavior.
The actual implementations are provided by Test::Class::Moose::Executor::Sequential
and Test::Class::Moose::Executor::Parallel
.
API
This role provides the following public methods for extensions. If you wrap any of the methods related to test execution you are strongly encouraged to make sure that the original method is called, as these methods implement the core functionality of TCM.
$executor->is_parallel
This returns a boolean indicating whether or not this executor will run test classes in parallel or not.
$executor->test_configuration
Returns the Test::Class::Moose::Config object for this executor.
$executor->test_report
Returns the Test::Class::Moose::Report object for this executor.
$executor->test_classes
Returns the list of test classes to be run, in the order that they should be run.
$executor->runtests
This is the primary entry method for test executor. It is called without any arguments and is expected to run all of the test classes defined in the test configuration.
$executor->run_test_class($test_class)
This method is called once for each test class to be run. It is passed a single argument, the name of the test class to be run.
$executor->run_test_instance($test_instance, $class_report)
This method is called once for each instance of a test class to be run. For most classes this is just called once but for classes which consume the Test::Class::Moose::Role::Parameterized role, it will be called more than once.
The first argument is the test class object to be run, and the second is an instance of Test::Class::Moose::Report::Class for the class being run.
$executor->run_test_method($test_instance, $test_method, $instance_report)
This method is called once for each test method in an instance to be run.
The first argument is the test class object to be run, the second is a method name, and the third is an instance of Test::Class::Moose::Report::Instance for the instance being run.
$executor->run_test_control_method($test_instance, $control_method, $instance_report)
This method is called once for each test method in an instance to be run.
The first argument is the test class object to be run, the second is a control method name (like 'test_startup'
), and the third is an instance of Test::Class::Moose::Report::Instance for the instance being run.
SUPPORT
Bugs may be submitted at https://github.com/houseabsolute/test-class-moose/issues.
I am also usually active on IRC as 'autarch' on irc://irc.perl.org
.
SOURCE
The source code repository for Test-Class-Moose can be found at https://github.com/houseabsolute/test-class-moose.
AUTHORS
Curtis "Ovid" Poe <ovid@cpan.org>
Dave Rolsky <autarch@urth.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 - 2021 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.
The full text of the license can be found in the LICENSE file included with this distribution.