sweetchuck/coverage-merger-cli

CLI tool to merge two or more coverage report files into one.

2.0.0 2022-01-28 19:43 UTC

This package is auto-updated.

Last update: 2024-10-26 19:21:51 UTC


README

CircleCI codecov

CLI tool to merge two or more coverage report files into one.

Requirements

  • PHP >=7.4
  • The input coverage report PHP files generated by phpunit/php-code-coverage ^9.0

For support of phpunit/php-code-coverage <9.0 check branch 1.x

Install as dependency

composer require --dev 'sweetchuck/coverage-merger-cli'

Install independently

  1. Download the coverage-merger.phar from the latest release
  2. mv ~/Downloads/coverage-merger.phar ~/bin/coverage-merger
    chmod +x ~/bin/coverage-merger

Usage

phpunit --coverage-php='reports/coverage/ATest.php' 'tests/src/Unit/ATest.php'
phpunit --coverage-php='reports/coverage/BTest.php' 'tests/src/Unit/BTest.php'
phpunit --coverage-php='reports/coverage/CTest.php' 'tests/src/Unit/CTest.php'

coverage-merger merge:files \
    'reports/coverage/ATest.php' \
    'reports/coverage/BTest.php' \
    'reports/coverage/CTest.php' \
    > 'reports/coverage.php'

# or
find ./reports/coverage/ -type f | coverage-merger merge:files --output-file='./reports/coverage.php'