Quieted test.py/bench.py status when stdout is aimed at stdout

This is a condition for specifically the -O- pattern. Doing anything
fancier would be too much, so anything clever such as -O/dev/stdout
will still be clobbered.

This was a common enough pattern and the status updates clobbering
stdout was annoying enough that I figured this warranted a special case.
This commit is contained in:
Christopher Haster
2024-03-20 13:58:22 -05:00
parent 76593711ab
commit 531c2bcc4c
2 changed files with 6 additions and 2 deletions

View File

@ -1119,7 +1119,9 @@ def run_stage(name, runner, test_ids, stdout_, trace_, output_, **args):
daemon=True))
def print_update(done):
if not args.get('verbose') and (args['color'] or done):
if (not args.get('verbose')
and not args.get('stdout') == '-'
and (args['color'] or done)):
sys.stdout.write('%s%srunning %s%s:%s %s%s' % (
'\r\x1b[K' if args['color'] else '',
'\x1b[?7l' if not done else '',