summaryrefslogtreecommitdiff
path: root/testsuite/driver/testlib.py
diff options
context:
space:
mode:
authorOleg Grenrus <oleg.grenrus@iki.fi>2019-05-08 09:35:15 +0300
committerBen Gamari <ben@smart-cactus.org>2019-05-14 16:41:19 -0400
commit5cf8032e2fd2a2f35b8de9016c6e38e92c524394 (patch)
treea9f17b8e93f8210530a4772f625b650642ce88e4 /testsuite/driver/testlib.py
parente529c65eacf595006dd5358491d28c202d673732 (diff)
downloadhaskell-5cf8032e2fd2a2f35b8de9016c6e38e92c524394.tar.gz
Update terminal title while running test-suite
Useful progress indicator even when `make test VERBOSE=1`, and when you do something else, but have terminal title visible.
Diffstat (limited to 'testsuite/driver/testlib.py')
-rw-r--r--testsuite/driver/testlib.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 95274f30e5..dc8b1b85f1 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -891,11 +891,17 @@ def do_test(name, way, func, args, files):
full_name = name + '(' + way + ')'
- if_verbose(2, "=====> {0} {1} of {2} {3}".format(
- full_name, t.total_tests, len(allTestNames),
+ progress_args = [ full_name, t.total_tests, len(allTestNames),
[len(t.unexpected_passes),
len(t.unexpected_failures),
- len(t.framework_failures)]))
+ len(t.framework_failures)]]
+ if_verbose(2, "=====> {0} {1} of {2} {3}".format(*progress_args))
+
+ # Update terminal title
+ # useful progress indicator even when make test VERBOSE=1
+ if config.supports_colors:
+ print("\033]0;{0} {1} of {2} {3}\007".format(*progress_args), end="")
+ sys.stdout.flush()
# Clean up prior to the test, so that we can't spuriously conclude
# that it passed on the basis of old run outputs.