Help language development. Donate to The Perl Foundation

App::RaCoCo zef:atroxaper last updated on 2021-12-27

bb459c52774ff53969192d9a03c745b02520c903/

Ubuntu MacOS Windows badge

NAME

App::RaCoCo - Raku Code Coverage tool.

SYNOPSIS

> racoco -l
[...]
All tests successful.
Files=16, Tests=114,  6 wallclock secs
Result: PASS
Coverage: 89.2%

> racoco --fail-level=95
[...]
Coverage: 89.2%
# exit code: 6

> racoco --html --silent
Visualisation: file://.racoco/report.html
Coverage: 89.2%
> browsername .racoco/report.html

INSTALLATION

If you use zef, then zef install App::RaCoCo, or pakku add App::RaCoCo if you use Pakku.

DESCRIPTION

App::RaCoCo provides the racoco application, which can be used to run tests and calculate code coverage.

You may specify the following options:

NOTES

CONFIGURATION FILE

Tests are a thing that it is customary to run frequently. If you run tests with a command more complicated than just rococo -l, then you will like the fact that you can write all the configurations to a special racoco.ini file. For example, you regularly run rococo -l and racoco -l --silent --html --fail-level=82 before commit. Then you can create a rococo.ini file in the root directory of your project with the following content:

exec = prove6 -l

[commit]
silent = true
reporter = html
fail-level = 82

After that just run racoco regularly and racoco commit before commit. As an alternative for configuration file you can use environment variables with appropriate names, or --property=name:value;name:value command-line option, or a combination of them. The priority is: command-line arguments > --property option > environment variables > racoco.ini file.

CUSTOM REPORTERS

In addition to the output of results to the console, Rococo supports additional reporters with the --reporter option. Examples of such reporters are html or html-color-blind which build a simple HTML page with results. Please look for other reporters in the Ecosystem.

Information for Developers

A custom reporter must implement App::Racoco::Report::Reporter role, has full qualified name like App::Racoco::Report::ReporterTheName and live in App::Racoco::Report::ReporterTheName compilation unit (file). Then you can address to it through --reporter=the-name. For example, see ReportHtmlColorBlind.rakumod.

AUTHOR

Mikhail Khorkov

Sources can be found at: github. The new Issues and Pull Requests are welcome.

COPYRIGHT AND LICENSE

Copyright 2021 Mikhail Khorkov

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.