]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
make python scripts more robust
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 18 Oct 2013 19:29:23 +0000 (19:29 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 18 Oct 2013 19:29:23 +0000 (19:29 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31311 0785d39b-7218-0410-832d-ea1e28bc413d

tests/scripts/makereport.py
tests/scripts/parse.py

index 2b0c5ca1c8d75dcfac735d161f440f92ffb2fac9..fba3599be18b6d56d26eec766f9b864b7bc72a30 100644 (file)
@@ -80,7 +80,9 @@ for test in testing.findall("Test"):
 
     status = 4
     if fail:
-        failtext = test.find('Results').find('Measurement').find('Value').text.encode('utf-8')
+        text = test.find('Results').find('Measurement').find('Value').text
+        if text == None: text=""
+        failtext = text.encode('utf-8')
         failtextlines = failtext.replace('"','').split('\n')
         failstatustxt = failtextlines[0].split(' ')[-1]
         for i in range(0,len(failtextlines)):
@@ -88,7 +90,7 @@ for test in testing.findall("Test"):
             if failstatustxt in statuslist:
                 status = statuslist.index(failstatustxt)
             else:
-                print "unknown status '%s'"%failstatustxt
+                print "unknown status '%s' in test %s "% (failstatustxt,name)
                 status=0           
 
     stati = [" 0  "," 1  "," 2  "," 3  ","  + "]
index b109e92f1f6657ab34b91eb462d6772d0aedfa80..001a37c4566d9e99dbeb4181602f7632435fd171 100644 (file)
@@ -50,7 +50,9 @@ def parse_revision(dirname):
         group = name.split('/')[0]
         status = 4
         if fail:
-            failtext = test.find('Results').find('Measurement').find('Value').text.encode('utf-8')
+            text = test.find('Results').find('Measurement').find('Value').text
+            if text == None: text=""
+            failtext = text.encode('utf-8')
             failtextlines = failtext.replace('"','').split('\n')
             failstatustxt = failtextlines[0].split(' ')[-1]
             for i in range(0,len(failtextlines)):
@@ -61,7 +63,7 @@ def parse_revision(dirname):
             if failstatustxt in statuslist:
                 status = statuslist.index(failstatustxt)
             else:
-                print "unknown status '%s'"%failstatustxt
+                print "unknown status '%s' in test %s "% (failstatustxt,name)
                 status=0           
 
         if not group in rev.groups:

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.