aprantl updated this revision to Diff 132888.
aprantl marked 17 inline comments as done.
aprantl added a comment.
Cleanup and address outstanding review feedback.
https://reviews.llvm.org/D42763
Files:
packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
packages/Python/lldbsuite/test/lldbtest.py
Index: packages/Python/lldbsuite/test/lldbtest.py
===================================================================
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -1501,14 +1501,10 @@
architecture=None,
compiler=None,
dictionary=None,
- clean=True,
- testdir=None,
- testname=None):
+ clean=True):
"""Platform specific way to build the default binaries."""
- if not testdir:
- testdir = self.mydir
- if not testname:
- testname = self.testMethodName
+ testdir = self.mydir
+ testname = self.testMethodName
if self.getDebugInfo():
raise Exception("buildDefault tests must set NO_DEBUG_INFO_TESTCASE")
module = builder_module()
@@ -1523,14 +1519,10 @@
architecture=None,
compiler=None,
dictionary=None,
- clean=True,
- testdir=None,
- testname=None):
+ clean=True):
"""Platform specific way to build binaries with dsym info."""
- if not testdir:
- testdir = self.mydir
- if not testname:
- testname = self.testMethodName
+ testdir = self.mydir
+ testname = self.testMethodName
if self.getDebugInfo() != "dsym":
raise Exception("NO_DEBUG_INFO_TESTCASE must build with buildDefault")
@@ -1545,14 +1537,10 @@
architecture=None,
compiler=None,
dictionary=None,
- clean=True,
- testdir=None,
- testname=None):
+ clean=True):
"""Platform specific way to build binaries with dwarf maps."""
- if not testdir:
- testdir = self.mydir
- if not testname:
- testname = self.testMethodName
+ testdir = self.mydir
+ testname = self.testMethodName
if self.getDebugInfo() != "dwarf":
raise Exception("NO_DEBUG_INFO_TESTCASE must build with buildDefault")
@@ -1567,14 +1555,10 @@
architecture=None,
compiler=None,
dictionary=None,
- clean=True,
- testdir=None,
- testname=None):
+ clean=True):
"""Platform specific way to build binaries with dwarf maps."""
- if not testdir:
- testdir = self.mydir
- if not testname:
- testname = self.testMethodName
+ testdir = self.mydir
+ testname = self.testMethodName
if self.getDebugInfo() != "dwo":
raise Exception("NO_DEBUG_INFO_TESTCASE must build with buildDefault")
@@ -1589,14 +1573,10 @@
architecture=None,
compiler=None,
dictionary=None,
- clean=True,
- testdir=None,
- testname=None):
+ clean=True):
"""Platform specific way to build binaries with gmodules info."""
- if not testdir:
- testdir = self.mydir
- if not testname:
- testname = self.testMethodName
+ testdir = self.mydir
+ testname = self.testMethodName
if self.getDebugInfo() != "gmodules":
raise Exception("NO_DEBUG_INFO_TESTCASE must build with buildDefault")
@@ -2323,19 +2303,17 @@
dictionary = lldbplatformutil.finalize_build_dictionary(dictionary)
if self.getDebugInfo() is None:
return self.buildDefault(architecture, compiler, dictionary,
- clean, self.mydir)
+ clean)
elif self.getDebugInfo() == "dsym":
- return self.buildDsym(architecture, compiler, dictionary,
- clean, self.mydir)
+ return self.buildDsym(architecture, compiler, dictionary, clean)
elif self.getDebugInfo() == "dwarf":
- return self.buildDwarf(architecture, compiler, dictionary,
- clean, self.mydir)
+ return self.buildDwarf(architecture, compiler, dictionary, clean)
elif self.getDebugInfo() == "dwo":
return self.buildDwo(architecture, compiler, dictionary,
- clean, self.mydir)
+ clean)
elif self.getDebugInfo() == "gmodules":
return self.buildGModules(architecture, compiler, dictionary,
- clean, self.mydir)
+ clean)
else:
self.fail("Can't build for debug info: %s" % self.getDebugInfo())
Index: packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
===================================================================
--- packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
+++ packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
@@ -22,6 +22,9 @@
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
+ 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',
@@ -96,10 +99,6 @@
@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'."""
- self.setup_test()
- # Invoke the default build rule.
- self.build()
-
if self.platformIsDarwin():
dylibName = 'libloadunload_d.dylib'
else:
@@ -159,9 +158,6 @@
@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."""
- self.setup_test()
- # Invoke the default build rule.
- self.build()
self.copy_shlibs_to_remote(hidden_dir=True)
exe = self.getBuildArtifact("a.out")
@@ -224,9 +220,6 @@
@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."""
- self.setup_test()
- # Invoke the default build rule.
- self.build()
self.copy_shlibs_to_remote()
exe = self.getBuildArtifact("a.out")
@@ -298,9 +291,6 @@
@skipIfFreeBSD # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase support
def test_load_unload(self):
"""Test breakpoint by name works correctly with dlopen'ing."""
- self.setup_test()
- # Invoke the default build rule.
- self.build()
self.copy_shlibs_to_remote()
exe = self.getBuildArtifact("a.out")
@@ -341,9 +331,6 @@
@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."""
- self.setup_test()
- # Invoke the default build rule.
- self.build()
self.copy_shlibs_to_remote()
exe = self.getBuildArtifact("a.out")
@@ -376,8 +363,6 @@
@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.setup_test()
- self.build()
self.copy_shlibs_to_remote()
exe = self.getBuildArtifact("a.out")
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits