Factored the "continue" command execution of the inferior process as part of the
cleanup before finish into the test fixture in lldbtest.TestBase.tearDown().

Derivatives of TestBase is responsible for setting self.runStarted to True if an
inferior process has been started.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@111188 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/lldbtest.py b/test/lldbtest.py
index 1987faa..75f7e51 100644
--- a/test/lldbtest.py
+++ b/test/lldbtest.py
@@ -64,6 +64,9 @@
     # The concrete subclass should override this attribute.
     mydir = None
 
+    # State pertaining to the inferior process, if any.
+    runStarted = False
+
     def setUp(self):
         #import traceback
         #traceback.print_stack()
@@ -101,6 +104,10 @@
 
 
     def tearDown(self):
+        # Finish the inferior process, if it was "run" previously.
+        if self.runStarted:
+            self.ci.HandleCommand("continue", self.res)
+
         del self.dbg
 
         # Restore old working directory.