[Piglit] [PATCH] framework: flush out screen prints explicitly

Ilia Mirkin imirkin at alum.mit.edu
Fri Feb 14 23:15:03 PST 2014


Without the flush, updates only happen whenever the buffer overfills,
which can be tens of tests.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
 framework/log.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/framework/log.py b/framework/log.py
index dcbe345..01c3a32 100644
--- a/framework/log.py
+++ b/framework/log.py
@@ -70,6 +70,9 @@ class Log(object):
         
         """
         sys.stdout.write("{0} {1} \r".format(self._percent(), self._running()))
+        # Need to flush explicitly, otherwise it all gets buffered without a
+        # newline.
+        sys.stdout.flush()
 
     @synchronized_self
     def get_current(self):
-- 
1.8.3.2



More information about the Piglit mailing list