From 531c2bcc4c54c59bd854df658722a1e1b54be704 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Wed, 20 Mar 2024 13:58:22 -0500 Subject: [PATCH] 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. --- scripts/bench.py | 4 +++- scripts/test.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/bench.py b/scripts/bench.py index 05331c37..de91cb19 100755 --- a/scripts/bench.py +++ b/scripts/bench.py @@ -1140,7 +1140,9 @@ def run_stage(name, runner, bench_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 '', diff --git a/scripts/test.py b/scripts/test.py index bc856ff4..5a2388c0 100755 --- a/scripts/test.py +++ b/scripts/test.py @@ -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 '',