diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-01-14 15:19:35 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-01-14 15:19:35 +0100 |
| commit | 66bfb5efc23b4dd9819bf70b5a709c81ccf7a820 (patch) | |
| tree | 49a09b1191058b9f94e0b52f0ecbf4cdbeb17dd9 /prettier.py | |
| parent | 5d6aa79961c10b56c6f59adf77ba00ddf296cdbe (diff) | |
| download | libasm_test-66bfb5efc23b4dd9819bf70b5a709c81ccf7a820.tar.gz libasm_test-66bfb5efc23b4dd9819bf70b5a709c81ccf7a820.tar.bz2 libasm_test-66bfb5efc23b4dd9819bf70b5a709c81ccf7a820.zip | |
Linux portability and fix prettier bug
Diffstat (limited to 'prettier.py')
| -rw-r--r-- | prettier.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/prettier.py b/prettier.py index 1b8ad0a..b8f4aab 100644 --- a/prettier.py +++ b/prettier.py @@ -34,7 +34,7 @@ def parse(): if line.find("SEGFAULT") != -1: name = line[4:] else: - m = re.search("^KO: \[COMPARE\]: (.*): expected: (.*) got: (.*) (with: .*)?$", line) + m = re.search("^KO: \[COMPARE\]: (.*): expected: (.*) got: (.*)( with: .*)?$", line) if m is None: print(line) print("PARSING ERROR") @@ -51,8 +51,10 @@ def parse(): "type": "COMPARE", "expected": m.group(2), "actual": m.group(3), - "with": m.group(4)[6:] + "with": None }) + if m.group(4) is not None: + l["ko_info"][-1]["with"] = m.group(4)[6:] if (l["ok_counter"] + l["ko_counter"]) % 15 == 0: print("\n", ''.join([" " for _ in range(1 + len(name))]), end="") print(red("[KO] "), end="") @@ -68,4 +70,7 @@ if __name__ == "__main__": if e['type'] == "SEGFAULT": print(f"{k} : {red('SEGFAULT')}") elif e['type'] == "COMPARE": - print(f"{k} with {e['with']}:\n {green('expected: ', e['expected'])}\n {red('actual: ', e['actual'])}") + p = f"{k}" + if e["with"] is not None: + p += f"with {e['with']}" + print(p, f":\n {green('expected: ', e['expected'])}\n {red('actual: ', e['actual'])}") |
