test-gdb: exit immediately in case of failure instead of hanging forever

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-01-22 00:00:00 +00:00
parent d3a839ea4a
commit ecee4738bc

View File

@@ -35,9 +35,15 @@ class GdbTestcase:
self.child.waitnoecho()
self.child.expect(self.prompt)
test = imp.load_source('test', test_script_path)
test.test(self)
exception = None
try:
test.test(self)
except AssertionError as e:
exception = e
self.child.sendcontrol('d')
self.child.close()
if exception is not None:
raise exception
def before(self):
return self.child.before.rstrip()