]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
fix script to accept new or old format
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 26 Sep 2013 15:06:10 +0000 (15:06 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 26 Sep 2013 15:06:10 +0000 (15:06 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@30956 0785d39b-7218-0410-832d-ea1e28bc413d

tests/scripts/makereport.py

index 75ac4e3cbe0b030effdde512f247620a0565b64f..1d6dc4c49e4a7145e542417c76a022c7f2615717 100644 (file)
@@ -25,36 +25,45 @@ class Revision:
 if len(sys.argv)==2:
     dirname=sys.argv[1].replace('/','')
 else:
-    n=glob.glob("*/Notes.xml")
+    n=glob.glob("*/Build.xml")
     n.sort(reverse=True)
-    dirname = n[0].replace('/Notes.xml','')
+    dirname = n[0].replace('/Build.xml','')
 
+if len(glob.glob(dirname+'/Update.xml'))>0:
+    #new format
+    tree = ET.parse(dirname+'/Update.xml')
+    name = tree.getroot().find('BuildName').text
+    number = tree.getroot().find('Revision').text
+    date = datetime.strptime(dirname,"%Y%m%d-%H%M")
+else:
+    #old format
     tree = ET.parse(dirname+'/Notes.xml')
     name = tree.getroot().attrib['BuildName']
     number = name.split('-')[-1]
+    number = number[1:]
     date = datetime.strptime(dirname,"%Y%m%d-%H%M")
 
-    print "Revision: %s"%number[1:]
-    print "Date: %s"%(date.strftime("%Y %j  %F  %U-%w"))
-    #print "Id:  %s"%name
-    id = subprocess.check_output(["id","-un"])+'@'+subprocess.check_output(["hostname"])
-    id=id.replace('\n','')
-    print "Id:  %s"%id
-
-    #now Test.xml:
-    tree = ET.parse(dirname+'/Test.xml')
-    root = tree.getroot()
-    testing = root.find('Testing')
-
-    for test in testing.findall("Test"):
-        status = test.attrib['Status']
-        fail=False
-        if status=="failed": fail=True
-        name = test.find('Name').text
-
-        if fail:
-            print "%s  3   %s"%(date,name)
-        else:
-            print "%s   +  %s"%(date,name)
+print "Revision: %s"%number
+print "Date: %s"%(date.strftime("%Y %j  %F  %U-%w"))
+#print "Id:  %s"%name
+id = subprocess.check_output(["id","-un"])+'@'+subprocess.check_output(["hostname"])
+id=id.replace('\n','')
+print "Id:  %s"%id
+
+#now Test.xml:
+tree = ET.parse(dirname+'/Test.xml')
+root = tree.getroot()
+testing = root.find('Testing')
+
+for test in testing.findall("Test"):
+    status = test.attrib['Status']
+    fail=False
+    if status=="failed": fail=True
+    name = test.find('Name').text
+
+    if fail:
+        print "%s  3   %s"%(date,name)
+    else:
+        print "%s   +  %s"%(date,name)
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.