From 4348027f3e96b966ff8fb1fb82be5fe06647067f Mon Sep 17 00:00:00 2001 From: Lou Berger Date: Wed, 31 Jan 2018 14:43:13 -0500 Subject: [PATCH] lib: add script name to summary output Signed-off-by: Lou Berger --- tests/topotests/lib/lutil.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/tests/topotests/lib/lutil.py b/tests/topotests/lib/lutil.py index f00f7ab71b..945e219e0c 100755 --- a/tests/topotests/lib/lutil.py +++ b/tests/topotests/lib/lutil.py @@ -58,6 +58,17 @@ class lUtil: if self.l_level > 5: print(str) + def summary(self, str): + if self.fsum == '': + self.fsum = open(self.fsum_name, 'w', 0) + self.fsum.write('\ +******************************************************************************\n') + self.fsum.write('\ +Test Target Summary Pass Fail\n') + self.fsum.write('\ +******************************************************************************\n') + self.fsum.write(str+'\n') + def result(self, target, success, str): if success: p = 1 @@ -69,15 +80,7 @@ class lUtil: self.l_fail += 1 res = "%-4d %-6s %-56s %-4d %d" % (self.l_total, target, str, p, f) self.log ('R:'+res) - if self.fsum == '': - self.fsum = open(self.fsum_name, 'w', 0) - self.fsum.write('\ -******************************************************************************\n') - self.fsum.write('\ -Test Target Summary Pass Fail\n') - self.fsum.write('\ -******************************************************************************\n') - self.fsum.write(res+'\n') + self.summary(res) if f == 1 and self.CallOnFail != False: self.CallOnFail() @@ -101,7 +104,9 @@ Total %-4d %-4d %d\n\ return ret def setFilename(self, name): - self.log('FILE: ' + name) + str = 'FILE: ' + name + self.log(str) + self.summary(str) self.l_filename = name self.line = 0 -- 2.39.5