babeuloula/phpunit-coverage-checker

PhpUnit 覆盖率检查器,如果覆盖率低于阈值则失败

v1.0.1 2021-07-12 12:41 UTC

This package is auto-updated.

Last update: 2024-09-12 21:02:06 UTC


README

此脚本将读取 XML 覆盖率结果并计算覆盖率分数。根据给定的阈值,如果覆盖率高于阈值则脚本退出(0),如果覆盖率低于阈值则退出(1)。

安装

composer require --dev babeuloula/phpunit-coverage-checker

使用方法

vendor/bin/coverage-checker <path/to/coverage/index.xml> <threshold>

示例

./vendor/bin/phpunit --coverage-xml ./coverage
vendor/bin/coverage-checker coverage/xml/index.xml 80

感谢

感谢richardregeercylab.be