[librsvg: 1/2] Hack around grcov bug to make the toplevel index.html actually show all source directories
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 1/2] Hack around grcov bug to make the toplevel index.html actually show all source directories
- Date: Sat, 15 Jan 2022 00:10:00 +0000 (UTC)
commit 7398d50940bbe32afee34d882b739a694e6ad955
Author: Federico Mena Quintero <federico gnome org>
Date: Fri Jan 14 17:42:33 2022 -0600
Hack around grcov bug to make the toplevel index.html actually show all source directories
Found a bug in grcov!
https://github.com/mozilla/grcov/issues/753
Normally, grcov creates this:
html/ substituted with the --output-path option's value
index.html index of all directories with their coverage summaries
src/
index.html summary of all source files in src/
foo.rs.html report for src/foo.rs
bar.rs.html report for src/bar.rs
However, the presence of build.rs in the toplevel source dir causes
grcov to overwrite its toplevel html/index.html (the index of all
directories) with the report for top_srcdir/index.html (the summary
for the toplevel source directory, that only lists build.rs).
So, we ignore build.rs for now in the HTML coverage report. I would
also like to get coverage info for build.rs, but it's not terribly
important right now. The only uncovered source lines in it are fatal
error handlers, the ones that would cause the build to fail anyway.
.gitlab-ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index eb881c701..301584975 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -124,7 +124,7 @@ coverage:
- cargo +nightly test --no-fail-fast || true
after_script:
- ./grcov . --binary-path ./target/debug/ --source-dir . --output-type cobertura --llvm --branch
--ignore-not-existing --ignore "*cargo*" -o coverage.xml
- - ./grcov . --binary-path ./target/debug/ --source-dir . --output-type html --llvm --branch
--ignore-not-existing --ignore "*cargo*" --output-path ./target/debug/coverage/
+ - ./grcov . --binary-path ./target/debug/ --source-dir . --output-type html --llvm --branch
--ignore-not-existing --ignore "build.rs" --output-path ./target/debug/coverage/
- mkdir -p public/coverage
- cp -r target/debug/coverage/* public/coverage
- grep -Eo 'line-rate="[^"]+"' coverage.xml | head -n 1 | grep -Eo '[0-9.]+' | awk '{ print "Coverage:",
$1 * 100 }'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]