diff options
author | Adrian Prantl <aprantl@apple.com> | 2020-01-14 12:34:13 -0800 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2020-01-14 12:35:24 -0800 |
commit | b53d44b17a1685e405415cd32c4b6eb89cc4c3a1 (patch) | |
tree | 1bc7e9cff0c9190f0c5eb0c372cfb32ac494cc55 /lldb/packages/Python/lldbsuite/test/dotest.py | |
parent | 337e4359645ebd0f35136dbec9b51c48b9071f9c (diff) | |
download | llvm-b53d44b17a1685e405415cd32c4b6eb89cc4c3a1.zip llvm-b53d44b17a1685e405415cd32c4b6eb89cc4c3a1.tar.gz llvm-b53d44b17a1685e405415cd32c4b6eb89cc4c3a1.tar.bz2 |
dotest.py: Add option to pass extra lldb settings to dotest
The primary motivation for this is to add another dimension to the
Swift LLDB test matrix, but this seems generally useful.
Differential Revision: https://reviews.llvm.org/D72662
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/dotest.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/dotest.py | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py index 4660055..560e47d 100644 --- a/lldb/packages/Python/lldbsuite/test/dotest.py +++ b/lldb/packages/Python/lldbsuite/test/dotest.py @@ -343,6 +343,14 @@ def parseOptionsAndInitTestdirs(): # that explicitly require no debug info. os.environ['CFLAGS'] = '-gdwarf-{}'.format(configuration.dwarf_version) + if args.settings: + for setting in args.settings: + if not len(setting) == 1 or not setting[0].count('='): + logging.error('"%s" is not a setting in the form "key=value"', + setting[0]) + sys.exit(-1) + configuration.settings.append(setting[0].split('=', 1)) + if args.d: sys.stdout.write( "Suspending the process %d to wait for debugger to attach...\n" % @@ -765,17 +773,15 @@ def visit(prefix, dir, names): raise -def disabledynamics(): +def setSetting(setting, value): import lldb ci = lldb.DBG.GetCommandInterpreter() res = lldb.SBCommandReturnObject() - ci.HandleCommand( - "setting set target.prefer-dynamic-value no-dynamic-values", - res, - False) + cmd = 'setting set %s %s'%(setting, value) + print(cmd) + ci.HandleCommand(cmd, res, False) if not res.Succeeded(): - raise Exception('disabling dynamic type support failed') - + raise Exception('failed to run "%s"'%cmd) # ======================================== # # # @@ -1060,8 +1066,9 @@ def run_suite(): # Now that we have loaded all the test cases, run the whole test suite. # - # Disable default dynamic types for testing purposes - disabledynamics() + # Set any user-overridden settings. + for key, value in configuration.settings: + setSetting(key, value) # Install the control-c handler. unittest2.signals.installHandler() |