8 # Fix paths in lcov files generated on a Windows host so they match our
9 # current source layout.
13 print("cov-fixup:", path)
14 text = io.open(path, "r", encoding="utf-8").read()
15 text = text.replace("\\\\", "/")
16 old_root = re.search(":(.*?)/glib/.*?$", text, re.MULTILINE).group(1)
17 new_root = os.path.dirname(os.getcwd())
18 if old_root != new_root:
19 print("replacing %r with %r" % (old_root, new_root))
20 text = text.replace(old_root, new_root)
21 with io.open(path, "w", encoding="utf-8") as h:
25 if __name__ == "__main__":
26 sys.exit(main(sys.argv))