self.filename = filename
def parseLine (self, line):
- if len(line) > 0 and line[0] == '#':
+ text = line.decode('utf-8')
+ if len(text) > 0 and text[0] == '#':
return self.parseContainerLine(line)
elif self.curResultText != None:
self.curResultText += line
def parseContainerLine (self, line):
isTestCaseResult = False
- args = splitContainerLine(line)
+ text = line.decode('utf-8')
+ args = splitContainerLine(text)
if args[0] == "#sessionInfo":
if len(args) < 3:
print(args)
if len(args) != 2 or self.curCaseName != None:
self.parseError("Invalid #beginTestCaseResult")
self.curCaseName = args[1]
- self.curResultText = ""
+ self.curResultText = b""
elif args[0] == "#endTestCaseResult":
if len(args) != 1 or self.curCaseName == None:
self.parseError("Invalid #endTestCaseResult")
])
def readMustpass (filename):
- f = open(filename, 'rb')
+ f = open(filename, 'rt')
cases = []
for line in f:
s = line.strip()
messages.append(error(filename, "Wrong number of test results, expected %d, found %d" % (len(mustpass), len(results))))
caseNameToResultNdx = {}
- for ndx in xrange(len(results)):
+ for ndx in range(len(results)):
result = results[ndx]
if not result in caseNameToResultNdx:
caseNameToResultNdx[result.name] = ndx
messages.append(error(filename, "Multiple results for " + result.name))
# Verify that all results are present and valid
- for ndx in xrange(len(mustpass)):
+ for ndx in range(len(mustpass)):
caseName = mustpass[ndx]
if caseName in caseNameToResultNdx: