Add support for mutually recursive imports.
1 # vim: set ts=2 sw=4 tw=99 ft=python et:
6 def __init__(self, ok, out, err, code, timeout, message):
11 self.timeout = timeout
12 self.message = message
15 def __init__(self, path, name, type):
21 return os.path.join(self.path, self.name + '.sp')
23 def compare(self, text):
26 with open(os.path.join(self.path, self.name + '.' + self.type), 'rt') as f:
27 text = str.replace(text, '\r', '')
28 lines = text.split('\n')
31 line = line.rstrip('\r\n')
32 if "Displaying compilation errors for" in lines[i]:
36 message = 'Got "' + lines[i] + '", expected "' + line + '"'
42 def check(self, out, err, code, timeout):
47 if self.type == 'err':
49 message = 'Expected failure, got success'
52 (ok, message) = self.compare(err)
53 elif self.type == 'out':
55 message = 'Expected success, got failure (code: ' + str(code) + ')'
58 (ok, message) = self.compare(out)
64 return Result(ok, out, err, code, timeout, message)