tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

report_error (1169B)


      1 #!/usr/bin/env python3
      2 
      3 import sys
      4 stem = sys.argv[1]
      5 
      6 # We "parse" the diff output, so we look at the lines that contain a "tee", like:
      7 # ├── +++ b/firefox
      8 # │ ├── +++ b/firefox/libxul.so
      9 # │ │ ├── readelf --wide --notes {}
     10 # We ignore lines like the last one, to only report file names. And we ignore
     11 # lines for directories such as the first one.
     12 TEE = "├── "
     13 VERTICAL_LINE = "│"
     14 paths = set()
     15 with open(f"{stem}.txt") as fh:
     16     for l in fh:
     17         l = l.rstrip()
     18         before, tee, after = l.partition(TEE)
     19         if not tee:
     20             continue
     21         before = before.split()
     22         assert all(x == VERTICAL_LINE for x in before)
     23         depth = len(before)
     24         _, plus, after = after.partition("+++ ")
     25         if not plus:
     26             continue
     27         _, b, full_path = after.partition("b/")
     28         assert b == "b/"
     29         parent_path = "/".join(full_path.split("/")[:-1])
     30         if parent_path in paths:
     31             paths.remove(parent_path)
     32         if full_path:
     33             paths.add(full_path)
     34 
     35 for p in sorted(paths):
     36     print(f"TEST-UNEXPECTED-FAIL | {p} differs. See the {stem}.html or {stem}.txt artifact")