Rand Stats



Ubuntu MacOS Windows Coverage Status


App::RaCoCo - Raku Code Coverage tool.


> 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


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


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

You may specify the following options:



Tests are a thing that it is customary to run frequently. If you run tests with a command more complicated than just racoco -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 racoco -l and racoco -l --silent --html --fail-level=82 before commit. Then you can create a racoco.ini file in the root directory of your project with the following content:

exec = prove6 -l

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.


In addition to the output of results to the console, Racoco 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.


Mikhail Khorkov <atroxaper[at]cpan.org>

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


Copyright 2023 Mikhail Khorkov

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