From 8084d94bdf005a688f5a089559f7aaea11417e39 Mon Sep 17 00:00:00 2001 From: heister Date: Thu, 26 Sep 2013 17:57:39 +0000 Subject: [PATCH] make html table pretty git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@30962 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/scripts/parse.py | 122 ++++++++++++++++++++++++++++++++++------- 1 file changed, 102 insertions(+), 20 deletions(-) diff --git a/tests/scripts/parse.py b/tests/scripts/parse.py index 70f76cd564..d4c32ca49a 100644 --- a/tests/scripts/parse.py +++ b/tests/scripts/parse.py @@ -8,6 +8,8 @@ class Group: self.n_fail = 0 self.fail = [] self.fail_text = {} + self.fail_status = {} + self.n_status = [0,0,0,0,0] class Revision: def __init__(self): @@ -42,25 +44,38 @@ def parse_revision(dirname): testing = root.find('Testing') for test in testing.findall("Test"): - status = test.attrib['Status'] fail=False - if status=="failed": fail=True + if test.attrib['Status']=="failed": fail=True name = test.find('Name').text group = name.split('/')[0] + status = 4 + if fail: + failtext = test.find('Results').find('Measurement').find('Value').text.encode('utf-8') + failtextlines = failtext.replace('"','').split('\n') + failstatustxt = failtextlines[0].split(' ')[-1] + for i in range(0,len(failtextlines)): + failtextlines[i] = failtextlines[i][0:80] + if failtextlines[i].startswith('FAILED: '): failtextlines[i]='FAILED: ...'; + failtext = '\n'.join(failtextlines[4:min(25,len(failtext))]) + statuslist=['CONFIGURE','BUILD','RUN','DIFF'] + if failstatustxt in statuslist: + status = statuslist.index(failstatustxt) + else: + print "unknown status '%s'"%failstatustxt + status=0 if not group in rev.groups: rev.groups[group]= Group(group) rev.groups[group].n_tests += 1 rev.n_tests += 1 + rev.groups[group].n_status[status] += 1 if fail: rev.groups[group].n_fail += 1 rev.n_fail += 1 rev.groups[group].fail.append(name) - failtext = test.find('Results').find('Measurement').find('Value').text.encode('utf-8') - failtext = failtext.replace('"','').split('\n') - failtext = '\n'.join(failtext[4:min(20,len(failtext))]) rev.groups[group].fail_text[name]=failtext + rev.groups[group].fail_status[name]=status for g in sorted(rev.groups): g = rev.groups[g] @@ -76,6 +91,7 @@ def parse_revision(dirname): n=glob.glob("*/Build.xml") n.sort(reverse=True) +numberofrevisions=10 n = n[0:min(10,len(n))] revs = [] @@ -100,11 +116,47 @@ f.write("""""") f.write("""