Clover Coverage Cli

Command line parser of clover.xml code coverage


I built this tool in PHP as a command line parser of clover.xml code coverage files. The idea was that it could be run as part of CI/CD against unit test coverage as a way of failing a deployment if a certain coverage threshold was not met.

At the time of writing the tool I thought it would be interesting to build a self-hosted reportage system that could consume the output of this tool and track a projects' coverage over time in the form of a pretty graph. I may eventually get round to building out Code Coverage Info but for now the cli tool is considered finished and the consumer api is not even started.


composer require photogabble/clover-coverage


analyse [FILE] [OPTION]...


  • -f, --failure-percentage
    Threshold below which files are marked as failed. Defaults to zero
  • -w, --warning-percentage
    Threshold below which files are marked as warning. Defaults to 90
  • -e, --error-percentage
    Threshold below which files are marked as error. Defaults to 80
  • -s, --summary
    Only show total coverage
  • --exit
    Exit with error code if overall coverage is equal to or less than failure percentage.

For example:

$: php .\bin\clover-coverage.php analyse clover.xml
=================================================================================== ===========
File Coverage
=================================================================================== ===========
H:\clover-coverage-cli\src\Analyser.php 100.00% ✓
H:\clover-coverage-cli\src\Analysis.php 100.00% ✓
H:\clover-coverage-cli\src\CloverCoverageApplication.php 100.00% ✓
H:\clover-coverage-cli\src\Commands/Analyse.php 100.00% ✓
=================================================================================== ===========
Code Coverage: 100.00%


This tool is open-sourced software licensed under the BSD 3-Clause License

Page History

This page was first added to the repository on February 16, 2022 in commit 8364ca11 and has since been amended 5 times. View the source on GitHub.

  1. refactor(#304): move files into src folder
  2. feat: update clover coverage project
  3. chore(#110): sets dates for all projects so that they are ordered chronographically
  4. refactor(#108): moves projects into content collection
  5. feat :: adds project language meta