diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2021-06-15 14:39:34 +0200 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2021-06-18 23:48:33 +0200 |
commit | 10afec575b528f192f4856c36169f0473bbdf18a (patch) | |
tree | 50c643bc7f694c47d97f4f9dabae0d995e180973 /run_project_tests.py | |
parent | 79fec1ce4efced7768ad7f3333f93fa9df7a34e1 (diff) | |
download | meson-10afec575b528f192f4856c36169f0473bbdf18a.zip meson-10afec575b528f192f4856c36169f0473bbdf18a.tar.gz meson-10afec575b528f192f4856c36169f0473bbdf18a.tar.bz2 |
tests: Add visual seperator to the test logs in run_project_tests.py
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-x | run_project_tests.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index d6dc5e1..9665f3e 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -1280,6 +1280,15 @@ def _run_tests(all_tests: T.List[T.Tuple[str, T.List[TestDef], bool]], safe_print(bold('During:'), result.step.name) safe_print(bold('Reason:'), result.msg) failing_tests += 1 + # Append a visual seperator for the different test cases + cols = shutil.get_terminal_size((100, 20)).columns + name_str = ' '.join([str(x) for x in f.testdef.display_name()]) + name_len = len(re.sub(r'\x1B[^m]+m', '', name_str)) # Do not count escape sequences + left_w = (cols // 2) - (name_len // 2) - 1 + left_w = max(3, left_w) + right_w = cols - left_w - name_len - 2 + right_w = max(3, right_w) + failing_logs.append(f'\n\x1b[31m{"="*left_w}\x1b[0m {name_str} \x1b[31m{"="*right_w}\x1b[0m\n') if result.step == BuildStep.configure and result.mlog != no_meson_log_msg: # For configure failures, instead of printing stdout, # print the meson log if available since it's a superset |