mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-22 17:08:53 +02:00
ci: collect test coverage and deploy a html report through gitlab pages
Use lcov for both Fedora and MSYS2 to create coverage reports and add a second ci stage which merges the coverage and creates a html report using genhtml. In the final stage, which is only run on master, the result is published on gitlab pages. https://bugzilla.gnome.org/show_bug.cgi?id=795636
This commit is contained in:
committed by
Philip Withnall
parent
e8798a4c22
commit
961be2b0bf
29
.gitlab-ci/fixup-cov-paths.py
Normal file
29
.gitlab-ci/fixup-cov-paths.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import sys
|
||||
import os
|
||||
import io
|
||||
|
||||
|
||||
def main(argv):
|
||||
# Fix paths in lcov files generated on a Windows host so they match our
|
||||
# current source layout.
|
||||
paths = argv[1:]
|
||||
|
||||
for path in paths:
|
||||
print("cov-fixup:", path)
|
||||
text = io.open(path, "r", encoding="utf-8").read()
|
||||
text = text.replace("\\\\", "/")
|
||||
glib_dir = "/glib/"
|
||||
end = text.index(glib_dir)
|
||||
start = text[:end].rindex(":") + 1
|
||||
old_root = text[start:end]
|
||||
assert os.path.basename(os.getcwd()) == "glib"
|
||||
new_root = os.path.dirname(os.getcwd())
|
||||
if old_root != new_root:
|
||||
print("replacing %r with %r" % (old_root, new_root))
|
||||
text = text.replace(old_root, new_root)
|
||||
with io.open(path, "w", encoding="utf-8") as h:
|
||||
h.write(text)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main(sys.argv))
|
Reference in New Issue
Block a user