From 9205a3ad82e8be25500b07c109f32fe98a5e5969 Mon Sep 17 00:00:00 2001 From: Aleksey Kulikov Date: Sat, 9 Oct 2021 14:18:27 +0300 Subject: [PATCH] docs: add instructions for test coverage --- .gitignore | 5 ++++- README.md | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4af3998..0c9f1f9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,7 @@ .packages .dart_tool .pub -pubspec.lock \ No newline at end of file +pubspec.lock + +# Coverage +coverage/ \ No newline at end of file diff --git a/README.md b/README.md index 1e0e3a3..1e19b98 100644 --- a/README.md +++ b/README.md @@ -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 +```