forked from OSchip/llvm-project
[debuginfo-tests][Dexter] Fix some Windows-unfriendly Dexter behaviours
These are some minor things that I've run into on Windows, largely in error handling paths: * Giving --lldb-executable on Windows triggers a "useless option" code path, which touches an attribute that only exists in the list_debuggers tool. Switch this to use hasattr, which will work in all subtools. * We were over-decoding some text reporting errors, but only in an exception path * The path to lldb on Windows needs to be quoted (even though dexter isn't making use of it). Differential Revision: https://reviews.llvm.org/D74546
This commit is contained in:
parent
ff7b5bac04
commit
5ee4a03bc9
|
@ -41,7 +41,7 @@ def _get_potential_debuggers(): # noqa
|
||||||
|
|
||||||
|
|
||||||
def _warn_meaningless_option(context, option):
|
def _warn_meaningless_option(context, option):
|
||||||
if context.options.list_debuggers:
|
if hasattr(context.options, 'list_debuggers'):
|
||||||
return
|
return
|
||||||
|
|
||||||
warn(context,
|
warn(context,
|
||||||
|
|
|
@ -58,7 +58,7 @@ class TestCase(object):
|
||||||
|
|
||||||
if self.error:
|
if self.error:
|
||||||
script_error = (' : {}'.format(
|
script_error = (' : {}'.format(
|
||||||
self.error.script_error.splitlines()[0].decode()) if getattr(
|
self.error.script_error.splitlines()[0]) if getattr(
|
||||||
self.error, 'script_error', None) else '')
|
self.error, 'script_error', None) else '')
|
||||||
|
|
||||||
error = ' [{}{}]'.format(
|
error = ' [{}{}]'.format(
|
||||||
|
|
|
@ -104,7 +104,7 @@ dexter_path = os.path.join(config.debuginfo_tests_src_root,
|
||||||
'dexter', 'dexter.py')
|
'dexter', 'dexter.py')
|
||||||
dexter_test_cmd = '"{}" "{}" test'.format(config.python3_executable, dexter_path)
|
dexter_test_cmd = '"{}" "{}" test'.format(config.python3_executable, dexter_path)
|
||||||
if lldb_path is not None:
|
if lldb_path is not None:
|
||||||
dexter_test_cmd += ' --lldb-executable {}'.format(lldb_path)
|
dexter_test_cmd += ' --lldb-executable "{}"'.format(lldb_path)
|
||||||
tools.append(ToolSubst('%dexter', dexter_test_cmd))
|
tools.append(ToolSubst('%dexter', dexter_test_cmd))
|
||||||
|
|
||||||
# For testing other bits of dexter that aren't under the "test" subcommand,
|
# For testing other bits of dexter that aren't under the "test" subcommand,
|
||||||
|
|
Loading…
Reference in New Issue