Test::Class::Moose::CLI - Use this in your tcm.t script for a drop-in runner tool
version 0.91
# In a t/tcm.t file ... use Test::Class::Moose::CLI; Test::Class::Moose::CLI->new_with_options->run; # From the command line ... $> prove -lv t/tcm.t :: --classes TestFor::Foo --classes TestFor::Bar --tags quick --tags db --jobs 8
This class provides support for passing various Test::Class::Moose::Config options via the command line.
It is entirely implemented by the Test::Class::Moose::Role::CLI role, which you can use in your own class to provide your own custom test runner.
This class allows you to pass the following command-line options:
This should be the full name of one a class that you want to run (rather than running classes). You can also pass a path to the class. Any leading t/lib/ part of the path will be stripped, and the rest will be transformed from a path to a module name. You can pass this option more than once.
t/lib/
The name of a method that you want to run. You can pass this option more than once.
This will actually be turned into a regex like qr/^(?:foo|bar)$/. It will be matched against all classes that are being run.
qr/^(?:foo|bar)$/
The name of a method that you do not want to run. You can pass this option more than once. This is turned into a regex just like --methods.
--methods
The name of one or more test method tags that you want to include. Only test method matching these tags will be run.
The name of one or more test method tags that you want to exclude. Any test methods matching these tags will be ignored.
Show a progress indicator when running tests in parallel. Defaults to true.
Enable/disable color for the parallel progress output. Defaults to true.
The number of jobs to run. Defaults to 1.
If true, methods for each class will be run in a random order. Defaults to false.
If true, classes will be run in a random order. Defaults to false.
If true, the process name ($0) will be updated to include the name of each test class as the class is being run.
$0
If true, this will output some extra statistics info as diagnostic output at the end of the run. Defaults to false unless --use-environment is true and the HARNESS_IS_VERBOSE environment variable is also true.
--use-environment
HARNESS_IS_VERBOSE
If true, this will output some extra timing info as diagnostic output at the end of the run. Defaults to false unless --use-environment is true and the HARNESS_IS_VERBOSE environment variable is also true.
The name of the runner class to use. Defaults to Test::Class::Moose::Runner. This class will be loaded when creating the runner if it is not already loaded.
If this is passed, the value returned by Test::Class::Moose::Report->timing_data plus some other information will be encoded as JSON and stored in this file. The exact data stored looks like:
Test::Class::Moose::Report->timing_data
{ process_name => $0, start_time => $epoch_time timing => \%timing_data_from_report, }
If you pass classes with the --classes option, only these classes will be loaded. Otherwise all classes under t/lib will be loaded.
--classes
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.
irc://irc.perl.org
The source code repository for Test-Class-Moose can be found at https://github.com/houseabsolute/test-class-moose.
Curtis "Ovid" Poe <ovid@cpan.org>
Dave Rolsky <autarch@urth.org>
This software is copyright (c) 2012 - 2017 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.
To install Test::Class::Moose, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Class::Moose
CPAN shell
perl -MCPAN -e shell install Test::Class::Moose
For more information on module installation, please visit the detailed CPAN module installation guide.