From: heister Date: Fri, 18 Oct 2013 19:29:23 +0000 (+0000) Subject: make python scripts more robust X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d8d8f6307c9bf18c0e49e61fd9a3e810b94b513;p=dealii-svn.git make python scripts more robust git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31311 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/scripts/makereport.py b/tests/scripts/makereport.py index 2b0c5ca1c8..fba3599be1 100644 --- a/tests/scripts/makereport.py +++ b/tests/scripts/makereport.py @@ -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 "," + "] diff --git a/tests/scripts/parse.py b/tests/scripts/parse.py index b109e92f1f..001a37c456 100644 --- a/tests/scripts/parse.py +++ b/tests/scripts/parse.py @@ -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: