mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 20:14:27 +01:00
test-gdb: exit immediately in case of failure instead of hanging forever
This commit is contained in:
8
run-gdb
8
run-gdb
@@ -35,9 +35,15 @@ class GdbTestcase:
|
|||||||
self.child.waitnoecho()
|
self.child.waitnoecho()
|
||||||
self.child.expect(self.prompt)
|
self.child.expect(self.prompt)
|
||||||
test = imp.load_source('test', test_script_path)
|
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.sendcontrol('d')
|
||||||
self.child.close()
|
self.child.close()
|
||||||
|
if exception is not None:
|
||||||
|
raise exception
|
||||||
|
|
||||||
def before(self):
|
def before(self):
|
||||||
return self.child.before.rstrip()
|
return self.child.before.rstrip()
|
||||||
|
|||||||
Reference in New Issue
Block a user