Skip to content

Update readme #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ CoverageBadge is a library for creating an SVG coverage badge from a Clover XML

## Installation

Composer

`composer require codebtech/coveragebadge --dev`

## Features
- Generate coverage badge from PHPUnit Clover XML file
- Generate coverage badge based on multiple Clover XML files, and it merges the coverage percentage automatically
- Can accept coverage name and the badge will be generated with the coverage name

- Produces a code coverage badge utilizing a Clover coverage XML file
- Creates a code coverage badge from several Clover XML files, automatically incorporating the coverage percentages
- Accepts a coverage name as an input to include in the generated badge

## Usage

1. Generate [XML Code Coverage](https://docs.phpunit.de/en/11.1/code-coverage.html) and generate [Clover](https://docs.phpunit.de/en/11.1/configuration.html#the-report-element) XML files.
2. Run `vendor/bin/coverage-badge /path/to/clover.xml /path/to/badge/destination.svg test-name`
3. To merge multiple clover files provide the input XML files `comma` separated run `vendor/bin/coverage-badge /path/to/clover.xml,/path/to/clover2.xml /path/to/badge/destination.svg test-name`
- Execute the command to generate badge for single Clover XML input
```
vendor/bin/coverage-badge /path/to/clover.xml /path/to/badge/destination.svg test-name
```
- To blend multiple Clover files, enumerate the XML inputs separated by commas and use the command
```
vendor/bin/coverage-badge /path/to/clover.xml,/path/to/clover2.xml /path/to/badge/destination.svg test-name
```