[CRIU] [PATCH] zdtm.py: Progress bar showing launching tests
Pavel Emelyanov
xemul at parallels.com
Fri Oct 30 08:50:56 PDT 2015
Asked-by: Andrey Vagin <avagin at odin.com>
Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
test/zdtm.py | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/test/zdtm.py b/test/zdtm.py
index dd94330..b1bf2b6 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -655,18 +655,27 @@ def do_run_test(tname, tdesc, flavs, opts):
print_sep("Test %s PASS" % tname)
class launcher:
- def __init__(self, opts):
+ def __init__(self, opts, nr_tests):
self.__opts = opts
+ self.__total = nr_tests
+ self.__nr = 0
self.__max = int(opts['parallel'] or 1)
self.__subs = {}
self.__fail = False
+ def __show_progress(self):
+ perc = self.__nr * 16 / self.__total
+ print "=== Run %d/%d %s" % (self.__nr, self.__total, '=' * perc + '-' * (16 - perc))
+
def run_test(self, name, desc, flavor):
if len(self.__subs) >= self.__max:
self.wait()
if self.__fail:
raise test_fail_exc('')
+ self.__nr += 1
+ self.__show_progress()
+
nd = ('nocr', 'norst', 'pre', 'iters', 'page_server', 'sibling', 'fault', 'keep_img', 'report')
arg = repr((name, desc, flavor, { d: self.__opts[d] for d in nd }))
log = name.replace('/', '_') + ".log"
@@ -771,7 +780,7 @@ def run_tests(opts):
if opts['report']:
init_report(opts['report'])
- l = launcher(opts)
+ l = launcher(opts, len(torun))
try:
for t in torun:
global arch
--
1.9.3
More information about the CRIU
mailing list