Simplify the base test class. Remove keyword argument setCookie from TestBase.runCmd() and

remove the self.runStarted attribute since the automatic shutdown of processes associated
with the targets are now performed automatically.

llvm-svn: 133092
This commit is contained in:
Johnny Chen 2011-06-15 21:38:39 +00:00
parent 3794ad95a7
commit 5b67ca8cc4
2 changed files with 2 additions and 12 deletions

View File

@ -60,7 +60,7 @@ class HelloWorldTestCase(TestBase):
#self.breakAfterLaunch(process, "main")
else:
# On the other hand, the following line of code are more reliable.
self.runCmd("run", setCookie=False)
self.runCmd("run")
self.process = target.GetProcess()
self.assertTrue(self.process, PROCESS_IS_VALID)

View File

@ -403,12 +403,6 @@ class TestBase(unittest2.TestCase):
# The concrete subclass should override this attribute.
mydir = None
# State pertaining to the inferior process, if any.
# This reflects inferior process started through the command interface with
# either the lldb "run" or "process launch" command.
# See also self.runCmd().
runStarted = False
# Maximum allowed attempts when launching the inferior process.
# Can be overridden by the LLDB_MAX_LAUNCH_COUNT environment variable.
maxLaunchCount = 3;
@ -738,7 +732,7 @@ class TestBase(unittest2.TestCase):
# Decide whether to dump the session info.
self.dumpSessionInfo()
def runCmd(self, cmd, msg=None, check=True, trace=False, setCookie=True):
def runCmd(self, cmd, msg=None, check=True, trace=False):
"""
Ask the command interpreter to handle the command and then check its
return status.
@ -772,10 +766,6 @@ class TestBase(unittest2.TestCase):
with recording(self, True) as sbuf:
print >> sbuf, "Command '" + cmd + "' failed!"
# Modify runStarted only if "run" or "process launch" was encountered.
if running:
self.runStarted = running and setCookie
if check:
self.assertTrue(self.res.Succeeded(),
msg if msg else CMD_MSG(cmd))