summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py3
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py1
-rw-r--r--lldb/packages/Python/lldbsuite/test/linux/add-symbols/TestTargetSymbolsAddCommand.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/linux/sepdebugsymlink/TestTargetSymbolsSepDebugSymlink.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbinline.py1
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py56
-rw-r--r--lldb/packages/Python/lldbsuite/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/plugins/builder_base.py15
-rw-r--r--lldb/packages/Python/lldbsuite/test/plugins/builder_darwin.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/plugins/builder_freebsd.py1
-rw-r--r--lldb/packages/Python/lldbsuite/test/plugins/builder_linux.py1
-rw-r--r--lldb/packages/Python/lldbsuite/test/plugins/builder_netbsd.py1
-rw-r--r--lldb/packages/Python/lldbsuite/test/plugins/builder_win32.py1
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py1
-rw-r--r--lldb/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py9
16 files changed, 31 insertions, 71 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 7f78c8656ba..4385304c88b 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
@@ -64,7 +64,6 @@ class CompDirSymLinkTestCase(TestBase):
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)
@@ -73,7 +72,7 @@ class CompDirSymLinkTestCase(TestBase):
return pwd_symlink
def doBuild(self, pwd_symlink):
- self.build(None, None, {'PWD': pwd_symlink}, True)
+ self.build(None, None, {'PWD': pwd_symlink})
exe = self.getBuildArtifact(_EXE_NAME)
self.runCmd('file ' + exe, CURRENT_EXECUTABLE_SET)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py b/lldb/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
index cf1c448022b..c6ad75f014e 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
@@ -30,7 +30,6 @@ class CommandScriptImmediateOutputTestCase (PExpectTest):
@expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr26139")
def test_command_script_immediate_output_console(self):
"""Test that LLDB correctly allows scripted commands to set immediate output to the console."""
- self.makeBuildDir()
self.launch(timeout=10)
script = os.path.join(self.getSourceDir(), 'custom_command.py')
@@ -53,7 +52,6 @@ class CommandScriptImmediateOutputTestCase (PExpectTest):
@expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr26139")
def test_command_script_immediate_output_file(self):
"""Test that LLDB correctly allows scripted commands to set immediate output to a file."""
- self.makeBuildDir()
self.launch(timeout=10)
test_files = {self.getBuildArtifact('read.txt'): 'r',
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py b/lldb/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
index ece566a64f3..52b1e8920e3 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
@@ -41,7 +41,6 @@ class ExecTestCase(TestBase):
self.do_test(True)
def do_test(self, skip_exec):
- self.makeBuildDir()
exe = self.getBuildArtifact("a.out")
if self.getArchitecture() == 'x86_64':
source = self.getSourcePath("main.cpp")
diff --git a/lldb/packages/Python/lldbsuite/test/linux/add-symbols/TestTargetSymbolsAddCommand.py b/lldb/packages/Python/lldbsuite/test/linux/add-symbols/TestTargetSymbolsAddCommand.py
index c8aa99d76ac..946c151bb8f 100644
--- a/lldb/packages/Python/lldbsuite/test/linux/add-symbols/TestTargetSymbolsAddCommand.py
+++ b/lldb/packages/Python/lldbsuite/test/linux/add-symbols/TestTargetSymbolsAddCommand.py
@@ -22,7 +22,7 @@ class TargetSymbolsAddCommand(TestBase):
"""Test that 'target symbols add' can load the symbols
even if gnu.build-id and gnu_debuglink are not present in the module.
Similar to test_add_dsym_mid_execution test for macos."""
- self.build(clean=True)
+ self.build()
exe = self.getBuildArtifact("stripped.out")
self.target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/linux/sepdebugsymlink/TestTargetSymbolsSepDebugSymlink.py b/lldb/packages/Python/lldbsuite/test/linux/sepdebugsymlink/TestTargetSymbolsSepDebugSymlink.py
index 541c3508c84..12506811c5e 100644
--- a/lldb/packages/Python/lldbsuite/test/linux/sepdebugsymlink/TestTargetSymbolsSepDebugSymlink.py
+++ b/lldb/packages/Python/lldbsuite/test/linux/sepdebugsymlink/TestTargetSymbolsSepDebugSymlink.py
@@ -17,7 +17,7 @@ class TestTargetSymbolsSepDebugSymlink(TestBase):
@skipIf(hostoslist=["windows"])
@skipIfRemote # llvm.org/pr36237
def test_target_symbols_sepdebug_symlink_case(self):
- self.build(clean=True)
+ self.build()
exe = self.getBuildArtifact("dirsymlink/stripped.symlink")
lldbutil.run_to_name_breakpoint(self, "main", exe_name = exe)
diff --git a/lldb/packages/Python/lldbsuite/test/lldbinline.py b/lldb/packages/Python/lldbsuite/test/lldbinline.py
index 31b4e474047..f180d146144 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbinline.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbinline.py
@@ -97,7 +97,6 @@ class InlineTest(TestBase):
return "-N dsym " + self.mydir
def BuildMakefile(self):
- self.makeBuildDir()
makefilePath = self.getBuildArtifact("Makefile")
if os.path.exists(makefilePath):
return
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 318c2a4cc42..4f8039906e5 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -44,6 +44,7 @@ import inspect
import io
import os.path
import re
+import shutil
import signal
from subprocess import *
import sys
@@ -697,17 +698,18 @@ class Base(unittest2.TestCase):
def getBuildDir(self):
"""Return the full path to the current test."""
- variant = self.getDebugInfo()
- if variant is None:
- variant = 'default'
return os.path.join(os.environ["LLDB_BUILD"], self.mydir,
self.getBuildDirBasename())
def makeBuildDir(self):
- """Create the test-specific working directory."""
+ """Create the test-specific working directory, deleting any previous
+ contents."""
# See also dotest.py which sets up ${LLDB_BUILD}.
- lldbutil.mkdir_p(self.getBuildDir())
+ bdir = self.getBuildDir()
+ if os.path.isdir(bdir):
+ shutil.rmtree(bdir)
+ lldbutil.mkdir_p(bdir)
def getBuildArtifact(self, name="a.out"):
"""Return absolute path to an artifact in the test's build directory."""
@@ -1490,26 +1492,23 @@ class Base(unittest2.TestCase):
self,
architecture=None,
compiler=None,
- dictionary=None,
- clean=True):
+ dictionary=None):
"""Platform specific way to build the default binaries."""
testdir = self.mydir
testname = self.getBuildDirBasename()
if self.getDebugInfo():
raise Exception("buildDefault tests must set NO_DEBUG_INFO_TESTCASE")
module = builder_module()
- self.makeBuildDir()
dictionary = lldbplatformutil.finalize_build_dictionary(dictionary)
if not module.buildDefault(self, architecture, compiler,
- dictionary, clean, testdir, testname):
+ dictionary, testdir, testname):
raise Exception("Don't know how to build default binary")
def buildDsym(
self,
architecture=None,
compiler=None,
- dictionary=None,
- clean=True):
+ dictionary=None):
"""Platform specific way to build binaries with dsym info."""
testdir = self.mydir
testname = self.getBuildDirBasename()
@@ -1519,15 +1518,14 @@ class Base(unittest2.TestCase):
module = builder_module()
dictionary = lldbplatformutil.finalize_build_dictionary(dictionary)
if not module.buildDsym(self, architecture, compiler,
- dictionary, clean, testdir, testname):
+ dictionary, testdir, testname):
raise Exception("Don't know how to build binary with dsym")
def buildDwarf(
self,
architecture=None,
compiler=None,
- dictionary=None,
- clean=True):
+ dictionary=None):
"""Platform specific way to build binaries with dwarf maps."""
testdir = self.mydir
testname = self.getBuildDirBasename()
@@ -1537,15 +1535,14 @@ class Base(unittest2.TestCase):
module = builder_module()
dictionary = lldbplatformutil.finalize_build_dictionary(dictionary)
if not module.buildDwarf(self, architecture, compiler,
- dictionary, clean, testdir, testname):
+ dictionary, testdir, testname):
raise Exception("Don't know how to build binary with dwarf")
def buildDwo(
self,
architecture=None,
compiler=None,
- dictionary=None,
- clean=True):
+ dictionary=None):
"""Platform specific way to build binaries with dwarf maps."""
testdir = self.mydir
testname = self.getBuildDirBasename()
@@ -1555,15 +1552,14 @@ class Base(unittest2.TestCase):
module = builder_module()
dictionary = lldbplatformutil.finalize_build_dictionary(dictionary)
if not module.buildDwo(self, architecture, compiler,
- dictionary, clean, testdir, testname):
+ dictionary, testdir, testname):
raise Exception("Don't know how to build binary with dwo")
def buildGModules(
self,
architecture=None,
compiler=None,
- dictionary=None,
- clean=True):
+ dictionary=None):
"""Platform specific way to build binaries with gmodules info."""
testdir = self.mydir
testname = self.getBuildDirBasename()
@@ -1573,7 +1569,7 @@ class Base(unittest2.TestCase):
module = builder_module()
dictionary = lldbplatformutil.finalize_build_dictionary(dictionary)
if not module.buildGModules(self, architecture, compiler,
- dictionary, clean, testdir, testname):
+ dictionary, testdir, testname):
raise Exception("Don't know how to build binary with gmodules")
def buildGo(self):
@@ -1869,7 +1865,6 @@ class TestBase(Base):
timeWaitNextLaunch = 1.0
def generateSource(self, source):
- self.makeBuildDir()
template = source + '.template'
temp = os.path.join(self.getSourceDir(), template)
with open(temp, 'r') as f:
@@ -2297,26 +2292,21 @@ class TestBase(Base):
self,
architecture=None,
compiler=None,
- dictionary=None,
- clean=True):
+ dictionary=None):
"""Platform specific way to build the default binaries."""
module = builder_module()
- self.makeBuildDir()
dictionary = lldbplatformutil.finalize_build_dictionary(dictionary)
if self.getDebugInfo() is None:
- return self.buildDefault(architecture, compiler, dictionary,
- clean)
+ return self.buildDefault(architecture, compiler, dictionary)
elif self.getDebugInfo() == "dsym":
- return self.buildDsym(architecture, compiler, dictionary, clean)
+ return self.buildDsym(architecture, compiler, dictionary)
elif self.getDebugInfo() == "dwarf":
- return self.buildDwarf(architecture, compiler, dictionary, clean)
+ return self.buildDwarf(architecture, compiler, dictionary)
elif self.getDebugInfo() == "dwo":
- return self.buildDwo(architecture, compiler, dictionary,
- clean)
+ return self.buildDwo(architecture, compiler, dictionary)
elif self.getDebugInfo() == "gmodules":
- return self.buildGModules(architecture, compiler, dictionary,
- clean)
+ return self.buildGModules(architecture, compiler, dictionary)
else:
self.fail("Can't build for debug info: %s" % self.getDebugInfo())
diff --git a/lldb/packages/Python/lldbsuite/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py b/lldb/packages/Python/lldbsuite/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
index 7e96d90fa1a..be122f4f500 100644
--- a/lldb/packages/Python/lldbsuite/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
+++ b/lldb/packages/Python/lldbsuite/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
@@ -25,7 +25,7 @@ class AddDsymMidExecutionCommandCase(TestBase):
@no_debug_info_test # Prevent the genaration of the dwarf version of this test
def test_add_dsym_mid_execution(self):
"""Test that add-dsym mid-execution loads the symbols at the right place for a slid binary."""
- self.buildDefault(clean=True, dictionary={'MAKE_DSYM':'YES'})
+ self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
exe = self.getBuildArtifact("a.out")
self.target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py b/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py
index dd5024c9f95..be891da2d08 100644
--- a/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py
+++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py
@@ -140,13 +140,10 @@ def buildDefault(
architecture=None,
compiler=None,
dictionary=None,
- clean=True,
testdir=None,
testname=None):
"""Build the binaries the default way."""
commands = []
- if clean:
- commands.append(getMake(testdir, testname) + ["clean", getCmdLine(dictionary)])
commands.append(getMake(testdir, testname) + ["all", getArchSpec(architecture),
getCCSpec(compiler), getCmdLine(dictionary)])
@@ -161,14 +158,10 @@ def buildDwarf(
architecture=None,
compiler=None,
dictionary=None,
- clean=True,
testdir=None,
testname=None):
"""Build the binaries with dwarf debug info."""
commands = []
- if clean:
- commands.append(getMake(testdir, testname) +
- ["clean", getCmdLine(dictionary)])
commands.append(getMake(testdir, testname) +
["MAKE_DSYM=NO", getArchSpec(architecture),
getCCSpec(compiler), getCmdLine(dictionary)])
@@ -183,14 +176,10 @@ def buildDwo(
architecture=None,
compiler=None,
dictionary=None,
- clean=True,
testdir=None,
testname=None):
"""Build the binaries with dwarf debug info."""
commands = []
- if clean:
- commands.append(getMake(testdir, testname) +
- ["clean", getCmdLine(dictionary)])
commands.append(getMake(testdir, testname) +
["MAKE_DSYM=NO", "MAKE_DWO=YES",
getArchSpec(architecture),
@@ -207,14 +196,10 @@ def buildGModules(
architecture=None,
compiler=None,
dictionary=None,
- clean=True,
testdir=None,
testname=None):
"""Build the binaries with dwarf debug info."""
commands = []
- if clean:
- commands.append(getMake(testdir, testname) +
- ["clean", getCmdLine(dictionary)])
commands.append(getMake(testdir, testname) +
["MAKE_DSYM=NO",
"MAKE_GMODULES=YES",
diff --git a/lldb/packages/Python/lldbsuite/test/plugins/builder_darwin.py b/lldb/packages/Python/lldbsuite/test/plugins/builder_darwin.py
index 61642bcee3e..1cee39bbb4c 100644
--- a/lldb/packages/Python/lldbsuite/test/plugins/builder_darwin.py
+++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_darwin.py
@@ -10,14 +10,10 @@ def buildDsym(
architecture=None,
compiler=None,
dictionary=None,
- clean=True,
testdir=None,
testname=None):
"""Build the binaries with dsym debug info."""
commands = []
- if clean:
- commands.append(getMake(testdir, testname) +
- ["clean", getCmdLine(dictionary)])
commands.append(getMake(testdir, testname) +
["MAKE_DSYM=YES",
getArchSpec(architecture),
diff --git a/lldb/packages/Python/lldbsuite/test/plugins/builder_freebsd.py b/lldb/packages/Python/lldbsuite/test/plugins/builder_freebsd.py
index e980336ff9d..c3df36b5a36 100644
--- a/lldb/packages/Python/lldbsuite/test/plugins/builder_freebsd.py
+++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_freebsd.py
@@ -6,6 +6,5 @@ def buildDsym(
architecture=None,
compiler=None,
dictionary=None,
- clean=True,
testdir=None):
return False
diff --git a/lldb/packages/Python/lldbsuite/test/plugins/builder_linux.py b/lldb/packages/Python/lldbsuite/test/plugins/builder_linux.py
index e980336ff9d..c3df36b5a36 100644
--- a/lldb/packages/Python/lldbsuite/test/plugins/builder_linux.py
+++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_linux.py
@@ -6,6 +6,5 @@ def buildDsym(
architecture=None,
compiler=None,
dictionary=None,
- clean=True,
testdir=None):
return False
diff --git a/lldb/packages/Python/lldbsuite/test/plugins/builder_netbsd.py b/lldb/packages/Python/lldbsuite/test/plugins/builder_netbsd.py
index e980336ff9d..c3df36b5a36 100644
--- a/lldb/packages/Python/lldbsuite/test/plugins/builder_netbsd.py
+++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_netbsd.py
@@ -6,6 +6,5 @@ def buildDsym(
architecture=None,
compiler=None,
dictionary=None,
- clean=True,
testdir=None):
return False
diff --git a/lldb/packages/Python/lldbsuite/test/plugins/builder_win32.py b/lldb/packages/Python/lldbsuite/test/plugins/builder_win32.py
index e980336ff9d..c3df36b5a36 100644
--- a/lldb/packages/Python/lldbsuite/test/plugins/builder_win32.py
+++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_win32.py
@@ -6,6 +6,5 @@ def buildDsym(
architecture=None,
compiler=None,
dictionary=None,
- clean=True,
testdir=None):
return False
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 068e968fb78..7b6ee55b250 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
@@ -27,7 +27,6 @@ class MiTestCaseBase(Base):
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/warnings/uuid/TestAddDsymCommand.py b/lldb/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py
index 633b26a0ad6..11c3bc86a6e 100644
--- a/lldb/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py
+++ b/lldb/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py
@@ -28,14 +28,14 @@ class AddDsymCommandCase(TestBase):
# Call the program generator to produce main.cpp, version 1.
self.generate_main_cpp(version=1)
- self.buildDefault(clean=True, dictionary={'MAKE_DSYM':'YES'})
+ self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
# Insert some delay and then call the program generator to produce
# main.cpp, version 2.
time.sleep(5)
self.generate_main_cpp(version=101)
# Now call make again, but this time don't generate the dSYM.
- self.buildDefault(clean=False, dictionary={'MAKE_DSYM':'NO'})
+ self.buildDefault(dictionary={'MAKE_DSYM':'NO'})
self.exe_name = 'a.out'
self.do_add_dsym_with_error(self.exe_name)
@@ -46,7 +46,7 @@ class AddDsymCommandCase(TestBase):
# Call the program generator to produce main.cpp, version 1.
self.generate_main_cpp(version=1)
- self.buildDefault(clean=True, dictionary={'MAKE_DSYM':'YES'})
+ self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
self.exe_name = 'a.out'
self.do_add_dsym_with_success(self.exe_name)
@@ -57,7 +57,7 @@ class AddDsymCommandCase(TestBase):
# Call the program generator to produce main.cpp, version 1.
self.generate_main_cpp(version=1)
- self.buildDefault(clean=True, dictionary={'MAKE_DSYM':'YES'})
+ self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
self.exe_name = 'a.out'
self.do_add_dsym_with_dSYM_bundle(self.exe_name)
@@ -72,7 +72,6 @@ class AddDsymCommandCase(TestBase):
'%ADD_EXTRA_CODE%',
'printf("This is version %d\\n");' %
version)
- self.makeBuildDir()
src = os.path.join(self.getBuildDir(), self.source)
with open(src, 'w') as f:
f.write(new_content)
OpenPOWER on IntegriCloud