Move getBuildArtifact() from TestBase to Base and derive MiTestCaseBase from it
authorAdrian Prantl <aprantl@apple.com>
Tue, 23 Jan 2018 16:43:01 +0000 (16:43 +0000)
committerAdrian Prantl <aprantl@apple.com>
Tue, 23 Jan 2018 16:43:01 +0000 (16:43 +0000)
Thanks to Pavel Labath for pointing this out!

llvm-svn: 323219

lldb/packages/Python/lldbsuite/test/lldbtest.py
lldb/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py

index b16c0c8..7b4dfa4 100644 (file)
@@ -717,6 +717,10 @@ class Base(unittest2.TestCase):
             lldb.remote_platform.Run(shell_cmd)
         self.addTearDownHook(clean_working_directory)
 
+    def getBuildArtifact(self, name="a.out"):
+        """Return absolute path to an artifact in the test's build directory."""
+        return os.path.join(os.getcwd(), name)
+
     def setUp(self):
         """Fixture for unittest test case setup.
 
@@ -2269,10 +2273,6 @@ class TestBase(Base):
         else:
             self.fail("Can't build for debug info: %s" % self.debug_info)
 
-    def getBuildArtifact(self, name="a.out"):
-        """Return absolute path to an artifact in the test's build directory."""
-        return os.path.join(os.getcwd(), name)
-            
     def run_platform_command(self, cmd):
         platform = self.dbg.GetSelectedPlatform()
         shell_command = lldb.SBPlatformShellCommand(cmd)
index e986204..6c38534 100644 (file)
@@ -8,7 +8,7 @@ from __future__ import print_function
 from lldbsuite.test.lldbtest import *
 
 
-class MiTestCaseBase(TestBase):
+class MiTestCaseBase(Base):
 
     mydir = None
     myexe = None