[lldb] Update TestMultithreaded to report FAIL for a non-zero exit code

A non-zero exit code from the test binary results in a
CalledProcessError. Without catching the exception, that would result in
a error (unresolved test) instead of a failure. This patch fixes that.
This commit is contained in:
Jonas Devlieghere 2022-06-08 08:45:53 -07:00
parent d3202a5923
commit 37028d3ea7
No known key found for this signature in database
GPG Key ID: 49CC0BD90FDEED4D
1 changed files with 9 additions and 6 deletions

View File

@ -108,12 +108,15 @@ class SBBreakpointCallbackCase(TestBase):
env = {self.dylibPath: self.getLLDBLibraryEnvVal()} env = {self.dylibPath: self.getLLDBLibraryEnvVal()}
if 'LLDB_DEBUGSERVER_PATH' in os.environ: if 'LLDB_DEBUGSERVER_PATH' in os.environ:
env['LLDB_DEBUGSERVER_PATH'] = os.environ['LLDB_DEBUGSERVER_PATH'] env['LLDB_DEBUGSERVER_PATH'] = os.environ['LLDB_DEBUGSERVER_PATH']
if self.TraceOn(): try:
print("Running test %s" % " ".join(exe)) if self.TraceOn():
check_call(exe, env=env) print("Running test %s" % " ".join(exe))
else: check_call(exe, env=env)
with open(os.devnull, 'w') as fnull: else:
check_call(exe, env=env, stdout=fnull, stderr=fnull) with open(os.devnull, 'w') as fnull:
check_call(exe, env=env, stdout=fnull, stderr=fnull)
except subprocess.CalledProcessError as e:
self.fail(e)
def build_program(self, sources, program): def build_program(self, sources, program):
return self.buildDriver(sources, program) return self.buildDriver(sources, program)