From 6851b60128d905d78fb8d5306402a255347a3e12 Mon Sep 17 00:00:00 2001 From: heister Date: Thu, 3 Oct 2013 01:47:18 +0000 Subject: [PATCH] grouping and repeat header git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31082 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/scripts/makereport.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/tests/scripts/makereport.py b/tests/scripts/makereport.py index 6cffbdd139..8ec7590608 100644 --- a/tests/scripts/makereport.py +++ b/tests/scripts/makereport.py @@ -49,27 +49,39 @@ else: number = number[1:] date = datetime.strptime(dirname,"%Y%m%d-%H%M") -print "Revision: %s"%number -print "Date: %s"%(date.strftime("%Y %j %F %U-%w")) -#print "Id: %s"%name +header = "Revision: %s"%number + "\n" +header += "Date: %s"%(date.strftime("%Y %j %F %U-%w")) + '\n' id = subprocess.check_output(["id","-un"])+'@'+subprocess.check_output(["hostname"]) id=id.replace('\n','') -print "Id: %s"%id +header += "Id: %s"%id #now Test.xml: tree = ET.parse(dirname+'/Test.xml') root = tree.getroot() testing = root.find('Testing') +tests={} + for test in testing.findall("Test"): status = test.attrib['Status'] fail=False if status=="failed": fail=True name = test.find('Name').text + group = name.split('/')[0] if fail: - print "%s 3 %s%s"%(date,branch,name) + line = "%s 3 %s%s"%(date,branch,name) else: - print "%s + %s%s"%(date,branch,name) + line = "%s + %s%s"%(date,branch,name) + + if group not in tests: tests[group]=[] + tests[group].append( line ) + +for g in sorted(tests): + group = tests[g] + print header + for l in group: + print l + -- 2.39.5