Print out incremental coverage after overall coverage
Sample output would look something like
Overall coverage rate:
lines......: 1.5% (29 of 1893 lines)
functions..: 2.3% (5 of 221 functions)
Incremental line coverage: 12.34%
Signed-off-by: Daniel Latypov <dlatypov@google.com>
Change-Id: Iceb3de8be72eb52cae8584caea27fd7c4e43eaaa
diff --git a/BUILD.bazel b/BUILD.bazel
index 199bb7c..34e4ee4 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -26,6 +26,7 @@
entrypoint = "/kunit.sh",
files = [
"kunit.sh",
+ "//lcov_parser:incremental_coverage",
"@kunitconfig_repo//:kunitconfig",
],
mode = "777",
diff --git a/kunit.sh b/kunit.sh
index 52a1585..4116104 100755
--- a/kunit.sh
+++ b/kunit.sh
@@ -83,6 +83,7 @@
echo "============================="
else
awk '/Overall coverage rate:/,EOF' "$ARTIFACTS/genhtml.log"
+ echo "Incremental line coverage: $(/incremental_coverage coverage.info)%"
fi
echo "============================="
diff --git a/lcov_parser/BUILD.bazel b/lcov_parser/BUILD.bazel
index d7a8386..591a5dc 100644
--- a/lcov_parser/BUILD.bazel
+++ b/lcov_parser/BUILD.bazel
@@ -25,6 +25,7 @@
py_binary(
name = "incremental_coverage",
srcs = ["incremental_coverage.py"],
+ visibility = ["//visibility:public"],
)
py_test(