[Piglit] [PATCH] framework: Make the logger print spinners instead of test numbers.

Kenneth Graunke kenneth at whitecape.org
Mon Nov 24 00:12:30 PST 2014


Printing out test numbers frequently exceeds the 80 character limit,
at which point the logger starts writing many copies of the progress
bar instead of overwriting it.  It also prompts people to say things
like "hey, test 8423 is broken!" without realizing that tests are run
in a nondeterministic order, so the number is meaningless.

The real point was to be able to see when a thread gets stuck - i.e.
one test keeps running forever.  We can easily show this with ASCII
progress spinners.

Instead of:

[16816/16822] crash: 21, fail: 82, pass: 12307, skip: 4401, warn: 5 Running Test(s): 16814 16815 16816 16817 16818 16819 16820 16821

We now get the much more compact:

[09984/16822] crash: 12, fail: 53, pass: 7314, skip: 2601, warn: 4: ||\-\|/-

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 framework/log.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/framework/log.py b/framework/log.py
index caad972..0c9489e 100644
--- a/framework/log.py
+++ b/framework/log.py
@@ -149,12 +149,12 @@ class QuietLog(BaseLog):
         """
         assert self._LOCK.locked()
 
-        out = '[{done}/{total}] {status} Running Test(s): {running}'.format(
+        out = '[{done}/{total}] {status}: {running}'.format(
             done=str(self._state['complete']).zfill(self._pad),
             total=str(self._state['total']).zfill(self._pad),
             status=', '.join('{0}: {1}'.format(k, v) for k, v in
                              sorted(self._state['summary'].iteritems())),
-            running=" ".join(str(x) for x in self._state['running'])
+            running=''.join('|/-\\'[x % 4] for x in self._state['running'])
         )
 
         self._print(out)
-- 
2.1.3



More information about the Piglit mailing list