[librsvg: 3/4] Extract the line coverage from the HTML report




commit c6da60841df05f4adb90efc056d6a2a0a78dc6ee
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Aug 5 14:35:33 2022 -0500

    Extract the line coverage from the HTML report
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/725>

 ci/gen-coverage.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/ci/gen-coverage.sh b/ci/gen-coverage.sh
index 328c9b4e6..dc62ff149 100644
--- a/ci/gen-coverage.sh
+++ b/ci/gen-coverage.sh
@@ -46,4 +46,7 @@ call_grcov html public/coverage
 
 # Print "Coverage: 42.42" so .gitlab-ci.yml will pick it up with a regex
 #
-# grep -Eo 'line-rate="[^"]+"' coverage.xml | head -n 1 | grep -Eo '[0-9.]+' | awk '{ print "Coverage:", $1 
* 100 }'
+# We scrape this from the HTML report, not the JSON summary, because coverage.json
+# uses no decimal places, just something like "42%".
+
+grep -Eo 'abbr title.* %' public/coverage/index.html | head -n 1 | grep -Eo '[0-9.]+ %' | grep -Eo '[0-9.]+' 
| awk '{ print "Coverage:", $1 }'


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]