mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-03-05 00:48:08 +00:00
If we spawn an lldb process for test (via pexpect), do not load the init file unless told otherwise.
Set up self.lldbOption to be "--no-lldbibit" unless env variable NO_LLDBIBIT is defined and equals "NO". Also add "-nx" to gdb spawned. llvm-svn: 141384
This commit is contained in:
parent
cf0e4f0daf
commit
ebe51726b8
@ -43,7 +43,7 @@ class DisassembleDriverMainLoop(BenchBase):
|
||||
prompt = self.child_prompt
|
||||
|
||||
# So that the child gets torn down after the test.
|
||||
self.child = pexpect.spawn('%s %s' % (self.lldbExec, exe))
|
||||
self.child = pexpect.spawn('%s %s %s' % (self.lldbExec, self.lldbOption, exe))
|
||||
child = self.child
|
||||
|
||||
# Turn on logging for what the child sends back.
|
||||
@ -83,7 +83,7 @@ class DisassembleDriverMainLoop(BenchBase):
|
||||
prompt = self.child_prompt
|
||||
|
||||
# So that the child gets torn down after the test.
|
||||
self.child = pexpect.spawn('gdb %s' % exe)
|
||||
self.child = pexpect.spawn('gdb --nx %s' % exe)
|
||||
child = self.child
|
||||
|
||||
# Turn on logging for what the child sends back.
|
||||
|
@ -49,7 +49,7 @@ class FlintVsSlateGDBDisassembly(BenchBase):
|
||||
prompt = self.child_prompt
|
||||
|
||||
# So that the child gets torn down after the test.
|
||||
self.child = pexpect.spawn('%s %s' % (gdb_exe_path, exe))
|
||||
self.child = pexpect.spawn('%s --nx %s' % (gdb_exe_path, exe))
|
||||
child = self.child
|
||||
|
||||
# Turn on logging for what the child sends back.
|
||||
|
@ -38,7 +38,7 @@ class RepeatedExprsCase(BenchBase):
|
||||
prompt = self.child_prompt
|
||||
|
||||
# So that the child gets torn down after the test.
|
||||
self.child = pexpect.spawn('%s %s' % (self.lldbExec, exe))
|
||||
self.child = pexpect.spawn('%s %s %s' % (self.lldbExec, self.lldbOption, exe))
|
||||
child = self.child
|
||||
|
||||
# Turn on logging for what the child sends back.
|
||||
@ -83,7 +83,7 @@ class RepeatedExprsCase(BenchBase):
|
||||
prompt = self.child_prompt
|
||||
|
||||
# So that the child gets torn down after the test.
|
||||
self.child = pexpect.spawn('gdb %s' % exe)
|
||||
self.child = pexpect.spawn('gdb --nx %s' % exe)
|
||||
child = self.child
|
||||
|
||||
# Turn on logging for what the child sends back.
|
||||
|
@ -18,7 +18,7 @@ class CommandRegexTestCase(TestBase):
|
||||
regex_prompt = "Enter regular expressions in the form 's/<regex>/<subst>/' and terminate with an empty line:\r\n"
|
||||
regex_prompt1 = "\r\n"
|
||||
|
||||
child = pexpect.spawn('%s' % self.lldbHere)
|
||||
child = pexpect.spawn('%s %s' % (self.lldbHere, self.lldbOption))
|
||||
# Turn on logging for what the child sends back.
|
||||
if self.TraceOn():
|
||||
child.logfile_read = sys.stdout
|
||||
|
@ -34,7 +34,7 @@ class ConvenienceVariablesCase(TestBase):
|
||||
python_prompt = ">>> "
|
||||
|
||||
# So that the child gets torn down after the test.
|
||||
self.child = pexpect.spawn('%s %s' % (self.lldbHere, exe))
|
||||
self.child = pexpect.spawn('%s %s %s' % (self.lldbHere, self.lldbOption, exe))
|
||||
child = self.child
|
||||
# Turn on logging for what the child sends back.
|
||||
if self.TraceOn():
|
||||
|
@ -40,7 +40,7 @@ class StopHookMechanismTestCase(TestBase):
|
||||
add_prompt1 = "\r\n> "
|
||||
|
||||
# So that the child gets torn down after the test.
|
||||
self.child = pexpect.spawn('%s %s' % (self.lldbHere, exe))
|
||||
self.child = pexpect.spawn('%s %s %s' % (self.lldbHere, self.lldbOption, exe))
|
||||
child = self.child
|
||||
# Turn on logging for what the child sends back.
|
||||
if self.TraceOn():
|
||||
|
@ -43,7 +43,7 @@ class StopHookForMultipleThreadsTestCase(TestBase):
|
||||
prompt = "(lldb) "
|
||||
|
||||
# So that the child gets torn down after the test.
|
||||
self.child = pexpect.spawn('%s %s' % (self.lldbHere, exe))
|
||||
self.child = pexpect.spawn('%s %s %s' % (self.lldbHere, self.lldbOption, exe))
|
||||
child = self.child
|
||||
# Turn on logging for what the child sends back.
|
||||
if self.TraceOn():
|
||||
|
@ -484,6 +484,12 @@ class Base(unittest2.TestCase):
|
||||
self.lldbHere = os.environ["LLDB_HERE"]
|
||||
else:
|
||||
self.lldbHere = None
|
||||
# If we spawn an lldb process for test (via pexpect), do not load the
|
||||
# init file unless told otherwise.
|
||||
if "NO_LLDBINIT" in os.environ and "NO" == os.environ["NO_LLDBINIT"]:
|
||||
self.lldbOption = ""
|
||||
else:
|
||||
self.lldbOption = "--no-lldbinit"
|
||||
|
||||
# Assign the test method name to self.testMethodName.
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user