NAME

Mojolicious::Command::coverage - Run your application with coverage statistics

SYNOPSIS

Usage: APPLICATION coverage [OPTIONS] [APPLICATION_OPTIONS]

./myapp.pl coverage [application arguments]

Options:
-h, --help                Shows this help
-c, --cover-args <args>   Options for Devel::Cover
-d, --deanon-args <args>  Options for Devel::Deanonymize (set to 0 to disable Devel::Deanonymize)

Application Options
- All parameters not matching [OPTIONS] are forwarded to the mojo application

DESCRIPTION

Starts your mojo application with Devel::Cover and optionally Devel::Deanonymize. In short this command does the following:

./myapp.pl coverage [application arguments]
# Is translated to
perl -I $INC[0] ... - I $INC[N] -MDevel::Cover=$coverageConfig -MDevel::Deanonymize=$deanonConfig myapp.pl [application arguments]

USAGE

Runtime configuration for both modules are either passed through the command-line arguments or by specifying has sections in your application:

has coverageConfig => sub{
    return "-ignore,t/,+ignore,prove,+ignore,thirdparty/,-coverage,statement,branch,condition,path,subroutine";
};

has deanonymizeConfig => sub {
    return "<Include-pattern>"
};

If both are present, command-line args are preferred. If none of them are present, we fall-back to these default values:

Devel::Cover

-ignore,t/,-coverage,statement,branch,condition,path,subroutine

Devel::Deanonymize

ref $self-app> ( -> Resolves to your application name)

EXAMPLES

# (with `has` sections or default config)
./myapp.pl coverage daemon --listen "http://*:8888"

# (with args)
./myapp.pl coverage -d MyPattern* daemon --listen "http://*:8888"

AUTHORS

Since there is a lot of spam flooding my mailbox, I had to put spam filtering in place. If you want to make sure that your email gets delivered into my mailbox, include #im_not_a_bot# in the subject! Tobias Bossert <tobib at cpan.org>

COPYRIGHT AND LICENSE

MIT License Copyright (c) 2022 Tobias Bossert Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.