docs: add instructions for test coverage

This commit is contained in:
Aleksey Kulikov 2021-10-09 14:18:27 +03:00
parent 101cf90875
commit 9205a3ad82
2 changed files with 21 additions and 1 deletions

5
.gitignore vendored
View file

@ -2,4 +2,7 @@
.packages
.dart_tool
.pub
pubspec.lock
pubspec.lock
# Coverage
coverage/

View file

@ -5,3 +5,20 @@ To generate bindings with ffigen use (adjust paths to yours):
```bash
dart run ffigen --compiler-opts "-I/path/to/libgit2dart/libgit2/headers/ -I/lib64/clang/12.0.1/include"
```
## Running Tests
To run all tests and generate coverage report use the following commands:
```sh
$ dart pub global activate coverage
$ dart test --coverage="coverage"
$ format_coverage --lcov --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):
```sh
$ genhtml coverage/lcov.info -o coverage/
$ open coverage/index.html
```