The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.


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



    ./ coverage [application arguments]

    -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


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

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


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:




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


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

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


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>


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.