Always remove all tmux logs

This commit is contained in:
Foo 2017-04-30 06:40:05 +03:00
parent afb6b0995d
commit e3d0649372

View File

@ -38,16 +38,20 @@ def cell_properties_key_to_shell_escape(cell_properties_key):
)) ))
def tmux_logs_iter(test_dir):
for tail in glob1(test_dir, '*.log'):
yield os.path.join(test_dir, tail)
def print_tmux_logs(): def print_tmux_logs():
for f in glob1(VTERM_TEST_DIR, '*.log'): for f in tmux_logs_iter(VTERM_TEST_DIR):
print('_' * 80) print('_' * 80)
print(f + ':') print(os.path.basename(f) + ':')
print('=' * 80) print('=' * 80)
full_f = os.path.join(VTERM_TEST_DIR, f) with open(f, 'r') as fp:
with open(full_f, 'r') as fp:
for line in fp: for line in fp:
sys.stdout.write(line) sys.stdout.write(line)
os.unlink(full_f) os.unlink(f)
def test_expected_result(p, expected_result, last_attempt, last_attempt_cb): def test_expected_result(p, expected_result, last_attempt, last_attempt_cb):
@ -328,6 +332,8 @@ def main(attempts=3):
print_exc() print_exc()
p.kill() p.kill()
p.join(10) p.join(10)
for f in tmux_logs_iter(VTERM_TEST_DIR):
os.unlink(f)
assert(not p.isAlive()) assert(not p.isAlive())
return main(attempts=(attempts - 1)) return main(attempts=(attempts - 1))