summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/functionalities
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2018-02-06 18:22:51 +0000
committerAdrian Prantl <aprantl@apple.com>2018-02-06 18:22:51 +0000
commit332351d9b98f993e4d0eb83a98ff4d4bb619b541 (patch)
tree342ad2040a651b28809035213b74aa0719f4910b /lldb/packages/Python/lldbsuite/test/functionalities
parent2f6412c38962193f085f7830fd54e693579a35d2 (diff)
downloadbcm5719-llvm-332351d9b98f993e4d0eb83a98ff4d4bb619b541.tar.gz
bcm5719-llvm-332351d9b98f993e4d0eb83a98ff4d4bb619b541.zip
Build each testcase variant in its own subdirectory and remove the srcdir lock file
This patch creates a <test>.dwarf, <test>.dwo, etc., build directory for each testcase variant. Most importantly, this eliminates the need for the per-test lock file in the source directory. Tests that are marked as NO_DEBUG_INFO_TESTCASE and build with buildDefault() are built in a <test>.default build directory. Differential Revision: https://reviews.llvm.org/D42763 llvm-svn: 324368
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py12
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py25
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py8
3 files changed, 17 insertions, 28 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
index 86ef0d72b58..7f78c8656ba 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
@@ -28,8 +28,6 @@ class CompDirSymLinkTestCase(TestBase):
self.line = line_number(
os.path.join(self.getSourceDir(), "main.cpp"),
'// Set break point at this line.')
- self.src_path = self.getBuildArtifact(_SRC_FILE)
-
@skipIf(hostoslist=["windows"])
def test_symlink_paths_set(self):
@@ -38,7 +36,8 @@ class CompDirSymLinkTestCase(TestBase):
self.runCmd(
"settings set %s %s" %
(_COMP_DIR_SYM_LINK_PROP, pwd_symlink))
- lldbutil.run_break_set_by_file_and_line(self, self.src_path, self.line)
+ src_path = self.getBuildArtifact(_SRC_FILE)
+ lldbutil.run_break_set_by_file_and_line(self, src_path, self.line)
@skipIf(hostoslist=no_match(["linux"]))
def test_symlink_paths_set_procselfcwd(self):
@@ -48,21 +47,24 @@ class CompDirSymLinkTestCase(TestBase):
self.runCmd(
"settings set %s %s" %
(_COMP_DIR_SYM_LINK_PROP, pwd_symlink))
- lldbutil.run_break_set_by_file_and_line(self, self.src_path, self.line)
+ src_path = self.getBuildArtifact(_SRC_FILE)
+ lldbutil.run_break_set_by_file_and_line(self, src_path, self.line)
@skipIf(hostoslist=["windows"])
def test_symlink_paths_unset(self):
pwd_symlink = self.create_src_symlink()
self.doBuild(pwd_symlink)
self.runCmd('settings clear ' + _COMP_DIR_SYM_LINK_PROP)
+ src_path = self.getBuildArtifact(_SRC_FILE)
self.assertRaises(
AssertionError,
lldbutil.run_break_set_by_file_and_line,
self,
- self.src_path,
+ src_path,
self.line)
def create_src_symlink(self):
+ self.makeBuildDir()
pwd_symlink = self.getBuildArtifact('pwd_symlink')
if os.path.exists(pwd_symlink):
os.unlink(pwd_symlink)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py b/lldb/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
index 7fb1cb4b605..d4af8c0db72 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
@@ -22,13 +22,18 @@ class LoadUnloadTestCase(TestBase):
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
- lldbutil.mkdir_p(self.getBuildArtifact("hidden"))
+ self.setup_test()
+ # Invoke the default build rule.
+ self.build()
# Find the line number to break for main.cpp.
self.line = line_number(
'main.cpp',
'// Set break point at this line for test_lldb_process_load_and_unload_commands().')
self.line_d_function = line_number(
'd.cpp', '// Find this line number within d_dunction().')
+
+ def setup_test(self):
+ lldbutil.mkdir_p(self.getBuildArtifact("hidden"))
if not self.platformIsDarwin():
if not lldb.remote_platform and "LD_LIBRARY_PATH" in os.environ:
self.runCmd(
@@ -94,10 +99,6 @@ class LoadUnloadTestCase(TestBase):
@skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
def test_modules_search_paths(self):
"""Test target modules list after loading a different copy of the library libd.dylib, and verifies that it works with 'target modules search-paths add'."""
-
- # Invoke the default build rule.
- self.build()
-
if self.platformIsDarwin():
dylibName = 'libloadunload_d.dylib'
else:
@@ -157,9 +158,6 @@ class LoadUnloadTestCase(TestBase):
@skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
def test_dyld_library_path(self):
"""Test (DY)LD_LIBRARY_PATH after moving libd.dylib, which defines d_function, somewhere else."""
-
- # Invoke the default build rule.
- self.build()
self.copy_shlibs_to_remote(hidden_dir=True)
exe = self.getBuildArtifact("a.out")
@@ -222,9 +220,6 @@ class LoadUnloadTestCase(TestBase):
@skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
def test_lldb_process_load_and_unload_commands(self):
"""Test that lldb process load/unload command work correctly."""
-
- # Invoke the default build rule.
- self.build()
self.copy_shlibs_to_remote()
exe = self.getBuildArtifact("a.out")
@@ -296,9 +291,6 @@ class LoadUnloadTestCase(TestBase):
@skipIfFreeBSD # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase support
def test_load_unload(self):
"""Test breakpoint by name works correctly with dlopen'ing."""
-
- # Invoke the default build rule.
- self.build()
self.copy_shlibs_to_remote()
exe = self.getBuildArtifact("a.out")
@@ -339,9 +331,6 @@ class LoadUnloadTestCase(TestBase):
@skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
def test_step_over_load(self):
"""Test stepping over code that loads a shared library works correctly."""
-
- # Invoke the default build rule.
- self.build()
self.copy_shlibs_to_remote()
exe = self.getBuildArtifact("a.out")
@@ -374,8 +363,6 @@ class LoadUnloadTestCase(TestBase):
@skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
def test_static_init_during_load(self):
"""Test that we can set breakpoints correctly in static initializers"""
-
- self.build()
self.copy_shlibs_to_remote()
exe = self.getBuildArtifact("a.out")
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py
index 7e0aa924f21..5b72f5edda7 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py
@@ -22,8 +22,10 @@ class TestValueOfVectorVariableTestCase(TestBase):
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
def test_value_of_vector_variable_using_watchpoint_set(self):
"""Test verify displayed value of vector variable."""
- self.build(dictionary=self.d)
- self.setTearDownCleanup(dictionary=self.d)
+ exe = self.getBuildArtifact("a.out")
+ d = {'C_SOURCES': self.source, 'EXE': exe}
+ self.build(dictionary=d)
+ self.setTearDownCleanup(dictionary=d)
self.value_of_vector_variable_with_watchpoint_set()
def setUp(self):
@@ -31,8 +33,6 @@ class TestValueOfVectorVariableTestCase(TestBase):
TestBase.setUp(self)
# Our simple source filename.
self.source = 'main.c'
- self.exe_name = self.getBuildArtifact("a.out")
- self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
def value_of_vector_variable_with_watchpoint_set(self):
"""Test verify displayed value of vector variable"""
OpenPOWER on IntegriCloud