summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/tools/lldb-mi
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2018-01-30 18:29:16 +0000
committerAdrian Prantl <aprantl@apple.com>2018-01-30 18:29:16 +0000
commit5ec76fe720e43a9196d3437e1ff448668bf7db6d (patch)
tree49d569898f53e6887e7167b4470b5e672ddf1541 /lldb/packages/Python/lldbsuite/test/tools/lldb-mi
parent1d8e5ea2500728cfc751ce055dd75e5084584e9c (diff)
downloadbcm5719-llvm-5ec76fe720e43a9196d3437e1ff448668bf7db6d.tar.gz
bcm5719-llvm-5ec76fe720e43a9196d3437e1ff448668bf7db6d.zip
Compile the LLDB tests out-of-tree.
This patch is the result of a discussion on lldb-dev, see http://lists.llvm.org/pipermail/lldb-dev/2018-January/013111.html for background. For each test (should be eventually: each test configuration) a separate build directory is created and we execute make VPATH=$srcdir/path/to/test -C $builddir/path/to/test -f $srcdir/path/to/test/Makefile -I $srcdir/path/to/test In order to make this work all LLDB tests need to be updated to find the executable in the test build directory, since CWD still points at the test's source directory, which is a requirement for unittest2. Although we have done extensive testing, I'm expecting that this first attempt will break a few bots. Please DO NOT HESITATE TO REVERT this patch in order to get the bots green again. We will likely have to iterate on this some more. Differential Revision: https://reviews.llvm.org/D42281 llvm-svn: 323803
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/tools/lldb-mi')
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiLibraryLoaded.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py5
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-mi/target/TestMiTarget.py9
5 files changed, 12 insertions, 8 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiLibraryLoaded.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiLibraryLoaded.py
index d4d7a484be4..c1c6faf10f0 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiLibraryLoaded.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiLibraryLoaded.py
@@ -29,7 +29,7 @@ class MiLibraryLoadedTestCase(lldbmi_testcase.MiTestCaseBase):
# Test =library-loaded
import os
- path = os.path.join(os.getcwd(), self.myexe)
+ path = self.getBuildArtifact(self.myexe)
symbols_path = os.path.join(
path + ".dSYM",
"Contents",
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
index 16f71fe8130..c8bb89e07f6 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
@@ -200,7 +200,7 @@ class MiBreakTestCase(lldbmi_testcase.MiTestCaseBase):
self.expect("\*stopped,reason=\"breakpoint-hit\"")
import os
- path = os.path.join(os.getcwd(), "main.cpp")
+ path = os.path.join(self.getSourceDir(), "main.cpp")
line = line_number('main.cpp', '// BP_return')
self.runCmd("-break-insert %s:%d" % (path, line))
self.expect("\^done,bkpt={number=\"2\"")
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
index 6c38534aec2..4ca40630c38 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
@@ -13,6 +13,7 @@ class MiTestCaseBase(Base):
mydir = None
myexe = None
mylog = None
+ NO_DEBUG_INFO_TESTCASE = True
@classmethod
def classCleanup(cls):
@@ -22,7 +23,11 @@ class MiTestCaseBase(Base):
TestBase.RemoveTempFile(cls.mylog)
def setUp(self):
+ if not self.mydir:
+ raise("mydir is empty")
+
Base.setUp(self)
+ self.makeBuildDir()
self.buildDefault()
self.child_prompt = "(gdb)"
self.myexe = self.getBuildArtifact("a.out")
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
index 6ac9bf81356..f396a0681cf 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
@@ -92,7 +92,7 @@ class MiSymbolTestCase(lldbmi_testcase.MiTestCaseBase):
# Test that -symbol-list-lines works when file is specified using
# absolute path
import os
- path = os.path.join(os.getcwd(), "main.cpp")
+ path = os.path.join(self.getSourceDir(), "main.cpp")
self.runCmd("-symbol-list-lines \"%s\"" % path)
self.expect(
"\^done,lines=\[\{pc=\"0x0*%x\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"\d+\"\})+\]" %
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/target/TestMiTarget.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/target/TestMiTarget.py
index 137408a2bd2..a3030582a86 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/target/TestMiTarget.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/target/TestMiTarget.py
@@ -32,7 +32,7 @@ class MiTargetTestCase(lldbmi_testcase.MiTestCaseBase):
# Load executable
# FIXME: -file-exec-and-sybmols is not required for target attach, but
# the test will not pass without this
- self.runCmd("-file-exec-and-symbols %s" % exeName)
+ self.runCmd("-file-exec-and-symbols %s" % self.getBuildArtifact(exeName))
self.expect("\^done")
# Set up attach
@@ -40,7 +40,7 @@ class MiTargetTestCase(lldbmi_testcase.MiTestCaseBase):
time.sleep(4) # Give attach time to setup
# Start target process
- self.spawnSubprocess(os.path.join(os.path.dirname(__file__), exeName))
+ self.spawnSubprocess(self.getBuildArtifact(exeName))
self.addTearDownHook(self.cleanupSubprocesses)
self.expect("\^done")
@@ -71,8 +71,7 @@ class MiTargetTestCase(lldbmi_testcase.MiTestCaseBase):
self.addTearDownCleanup(dictionary=d)
# Start target process
- targetProcess = self.spawnSubprocess(
- os.path.join(os.path.dirname(__file__), exeName))
+ targetProcess = self.spawnSubprocess(self.getBuildArtifact(exeName))
self.addTearDownHook(self.cleanupSubprocesses)
self.spawnLldbMi(args=None)
@@ -109,7 +108,7 @@ class MiTargetTestCase(lldbmi_testcase.MiTestCaseBase):
# Start target process
targetProcess = self.spawnSubprocess(
- os.path.join(os.path.dirname(__file__), exeName))
+ self.getBuildArtifact(exeName))
self.addTearDownHook(self.cleanupSubprocesses)
self.spawnLldbMi(args=None)
OpenPOWER on IntegriCloud