From ecee4738bccff76570a1465b729ee6a7b1728b01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Tue, 22 Jan 2019 00:00:00 +0000 Subject: [PATCH] test-gdb: exit immediately in case of failure instead of hanging forever --- run-gdb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/run-gdb b/run-gdb index 84dfddc..332454e 100755 --- a/run-gdb +++ b/run-gdb @@ -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()