summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py
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/warnings/uuid/TestAddDsymCommand.py
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/warnings/uuid/TestAddDsymCommand.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py b/lldb/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py
index 11a7d6f41fb..c75f7f293fa 100644
--- a/lldb/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py
+++ b/lldb/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py
@@ -64,7 +64,7 @@ class AddDsymCommandCase(TestBase):
def generate_main_cpp(self, version=0):
"""Generate main.cpp from main.cpp.template."""
- temp = os.path.join(os.getcwd(), self.template)
+ temp = os.path.join(self.getSourceDir(), self.template)
with open(temp, 'r') as f:
content = f.read()
@@ -72,7 +72,8 @@ class AddDsymCommandCase(TestBase):
'%ADD_EXTRA_CODE%',
'printf("This is version %d\\n");' %
version)
- src = os.path.join(os.getcwd(), self.source)
+ self.makeBuildDir()
+ src = os.path.join(self.getBuildDir(), self.source)
with open(src, 'w') as f:
f.write(new_content)
@@ -86,11 +87,13 @@ class AddDsymCommandCase(TestBase):
exe_path = self.getBuildArtifact(exe_name)
self.runCmd("file " + exe_path, CURRENT_EXECUTABLE_SET)
- wrong_path = os.path.join("%s.dSYM" % exe_name, "Contents")
+ wrong_path = os.path.join(self.getBuildDir(),
+ "%s.dSYM" % exe_name, "Contents")
self.expect("add-dsym " + wrong_path, error=True,
substrs=['invalid module path'])
right_path = os.path.join(
+ self.getBuildDir(),
"%s.dSYM" %
exe_path,
"Contents",
@@ -108,6 +111,7 @@ class AddDsymCommandCase(TestBase):
# This time, the UUID should match and we expect some feedback from
# lldb.
right_path = os.path.join(
+ self.getBuildDir(),
"%s.dSYM" %
exe_path,
"Contents",
OpenPOWER on IntegriCloud