mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
chore: add coverage badge
This commit is contained in:
parent
23d6a7f332
commit
ed62447eb2
3 changed files with 34 additions and 7 deletions
19
README.md
19
README.md
|
@ -1,5 +1,7 @@
|
||||||
# libgit2dart
|
# libgit2dart
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
**Dart bindings to libgit2**
|
**Dart bindings to libgit2**
|
||||||
|
|
||||||
libgit2dart package provides ability to use [libgit2](https://github.com/libgit2/libgit2) in Dart/Flutter.
|
libgit2dart package provides ability to use [libgit2](https://github.com/libgit2/libgit2) in Dart/Flutter.
|
||||||
|
@ -717,6 +719,8 @@ submodule.sync();
|
||||||
|
|
||||||
Fork libgit2dart, improve libgit2dart, send a pull request.
|
Fork libgit2dart, improve libgit2dart, send a pull request.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
### Troubleshooting
|
### Troubleshooting
|
||||||
|
@ -743,23 +747,24 @@ To generate bindings with ffigen use (adjust paths to yours):
|
||||||
dart run ffigen --compiler-opts "-I/path/to/libgit2dart/libgit2/headers/ -I/lib64/clang/12.0.1/include"
|
dart run ffigen --compiler-opts "-I/path/to/libgit2dart/libgit2/headers/ -I/lib64/clang/12.0.1/include"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Running Tests
|
### Running Tests
|
||||||
|
|
||||||
To run all tests and generate coverage report use the following commands:
|
To run all tests and generate coverage report make sure to have activated packages and [lcov](https://github.com/linux-test-project/lcov) installed:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ dart pub global activate coverage
|
$ dart pub global activate coverage
|
||||||
$ dart test --coverage="coverage"
|
$ dart pub global activate flutter_coverage_badge
|
||||||
$ format_coverage --lcov --check-ignore --in=coverage --out=coverage/lcov.info --packages=.packages --report-on=lib
|
|
||||||
```
|
```
|
||||||
|
|
||||||
To view the generated coverage report you can use [lcov](https://github.com/linux-test-project/lcov):
|
And run:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ genhtml coverage/lcov.info -o coverage/
|
$ ./coverage.sh
|
||||||
$ open coverage/index.html
|
$ open coverage/index.html
|
||||||
```
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Licence
|
## Licence
|
||||||
|
|
||||||
MIT. See LICENSE file for more information.
|
MIT. See [LICENSE](LICENSE) file for more information.
|
||||||
|
|
2
coverage.sh
Executable file
2
coverage.sh
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/bash
|
||||||
|
dart test --coverage="coverage" --test-randomize-ordering-seed random && format_coverage --lcov --check-ignore --in=coverage --out=coverage/lcov.info --packages=.packages --report-on=lib && genhtml coverage/lcov.info -o coverage/ && dart pub global run flutter_coverage_badge
|
20
coverage_badge.svg
Normal file
20
coverage_badge.svg
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="102" height="20">
|
||||||
|
<linearGradient id="b" x2="0" y2="100%">
|
||||||
|
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
||||||
|
<stop offset="1" stop-opacity=".1"/>
|
||||||
|
</linearGradient>
|
||||||
|
<clipPath id="a">
|
||||||
|
<rect width="102" height="20" rx="3" fill="#fff"/>
|
||||||
|
</clipPath>
|
||||||
|
<g clip-path="url(#a)">
|
||||||
|
<path fill="#555" d="M0 0h59v20H0z"/>
|
||||||
|
<path fill="#44cc11" d="M59 0h43v20H59z"/>
|
||||||
|
<path fill="url(#b)" d="M0 0h102v20H0z"/>
|
||||||
|
</g>
|
||||||
|
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110">
|
||||||
|
<text x="305" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="490">coverage</text>
|
||||||
|
<text x="305" y="140" transform="scale(.1)" textLength="490">coverage</text>
|
||||||
|
<text x="795" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="330">100%</text>
|
||||||
|
<text x="795" y="140" transform="scale(.1)" textLength="330">100%</text>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1 KiB |
Loading…
Add table
Add a link
Reference in a new issue