diff options
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/plugins')
6 files changed, 91 insertions, 21 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py b/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py index a467a458d5d..bd6656bd5e8 100644 --- a/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py +++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py @@ -23,36 +23,41 @@ import lldbsuite.test.lldbtest as lldbtest import lldbsuite.test.lldbutil as lldbutil from lldbsuite.test_event import build_exception + def getArchitecture(): """Returns the architecture in effect the test suite is running with.""" return os.environ["ARCH"] if "ARCH" in os.environ else "" + def getCompiler(): """Returns the compiler in effect the test suite is running with.""" compiler = os.environ.get("CC", "clang") compiler = lldbutil.which(compiler) return os.path.realpath(compiler) + def getArchFlag(): """Returns the flag required to specify the arch""" compiler = getCompiler() if compiler is None: - return "" + return "" elif "gcc" in compiler: - archflag = "-m" + archflag = "-m" elif "clang" in compiler: - archflag = "-arch" + archflag = "-arch" else: - archflag = None + archflag = None return ("ARCHFLAG=" + archflag) if archflag else "" + def getMake(): """Returns the name for GNU make""" if platform.system() == "FreeBSD" or platform.system() == "NetBSD": - return "gmake" + return "gmake" else: - return "make" + return "make" + def getArchSpec(architecture): """ @@ -65,6 +70,7 @@ def getArchSpec(architecture): return ("ARCH=" + arch) if arch else "" + def getCCSpec(compiler): """ Helper function to return the key-value string to specify the compiler @@ -78,6 +84,7 @@ def getCCSpec(compiler): else: return "" + def getCmdLine(d): """ Helper function to return a properly formatted command line argument(s) @@ -109,55 +116,87 @@ def runBuildCommands(commands, sender): raise build_exception.BuildError(called_process_error) -def buildDefault(sender=None, architecture=None, compiler=None, dictionary=None, clean=True): +def buildDefault( + sender=None, + architecture=None, + compiler=None, + dictionary=None, + clean=True): """Build the binaries the default way.""" commands = [] if clean: commands.append([getMake(), "clean", getCmdLine(dictionary)]) - commands.append([getMake(), getArchSpec(architecture), getCCSpec(compiler), getCmdLine(dictionary)]) + commands.append([getMake(), getArchSpec(architecture), + getCCSpec(compiler), getCmdLine(dictionary)]) runBuildCommands(commands, sender=sender) # True signifies that we can handle building default. return True -def buildDwarf(sender=None, architecture=None, compiler=None, dictionary=None, clean=True): + +def buildDwarf( + sender=None, + architecture=None, + compiler=None, + dictionary=None, + clean=True): """Build the binaries with dwarf debug info.""" commands = [] if clean: commands.append([getMake(), "clean", getCmdLine(dictionary)]) - commands.append([getMake(), "MAKE_DSYM=NO", getArchSpec(architecture), getCCSpec(compiler), getCmdLine(dictionary)]) + commands.append([getMake(), "MAKE_DSYM=NO", getArchSpec( + architecture), getCCSpec(compiler), getCmdLine(dictionary)]) runBuildCommands(commands, sender=sender) # True signifies that we can handle building dwarf. return True -def buildDwo(sender=None, architecture=None, compiler=None, dictionary=None, clean=True): + +def buildDwo( + sender=None, + architecture=None, + compiler=None, + dictionary=None, + clean=True): """Build the binaries with dwarf debug info.""" commands = [] if clean: commands.append([getMake(), "clean", getCmdLine(dictionary)]) - commands.append([getMake(), "MAKE_DSYM=NO", "MAKE_DWO=YES", getArchSpec(architecture), getCCSpec(compiler), getCmdLine(dictionary)]) + commands.append([getMake(), "MAKE_DSYM=NO", "MAKE_DWO=YES", getArchSpec( + architecture), getCCSpec(compiler), getCmdLine(dictionary)]) runBuildCommands(commands, sender=sender) # True signifies that we can handle building dwo. return True -def buildGModules(sender=None, architecture=None, compiler=None, dictionary=None, clean=True): + +def buildGModules( + sender=None, + architecture=None, + compiler=None, + dictionary=None, + clean=True): """Build the binaries with dwarf debug info.""" commands = [] if clean: commands.append([getMake(), "clean", getCmdLine(dictionary)]) - commands.append([getMake(), "MAKE_DSYM=NO", "MAKE_GMODULES=YES", getArchSpec(architecture), getCCSpec(compiler), getCmdLine(dictionary)]) + commands.append([getMake(), + "MAKE_DSYM=NO", + "MAKE_GMODULES=YES", + getArchSpec(architecture), + getCCSpec(compiler), + getCmdLine(dictionary)]) lldbtest.system(commands, sender=sender) # True signifies that we can handle building with gmodules. return True + def cleanup(sender=None, dictionary=None): """Perform a platform-specific cleanup after the test.""" #import traceback - #traceback.print_stack() + # traceback.print_stack() commands = [] if os.path.isfile("Makefile"): commands.append([getMake(), "clean", getCmdLine(dictionary)]) diff --git a/lldb/packages/Python/lldbsuite/test/plugins/builder_darwin.py b/lldb/packages/Python/lldbsuite/test/plugins/builder_darwin.py index 8a907ccec2d..06a2a86d47a 100644 --- a/lldb/packages/Python/lldbsuite/test/plugins/builder_darwin.py +++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_darwin.py @@ -5,13 +5,20 @@ import lldbsuite.test.lldbtest as lldbtest from builder_base import * -def buildDsym(sender=None, architecture=None, compiler=None, dictionary=None, clean=True): + +def buildDsym( + sender=None, + architecture=None, + compiler=None, + dictionary=None, + clean=True): """Build the binaries with dsym debug info.""" commands = [] if clean: commands.append(["make", "clean", getCmdLine(dictionary)]) - commands.append(["make", "MAKE_DSYM=YES", getArchSpec(architecture), getCCSpec(compiler), getCmdLine(dictionary)]) + commands.append(["make", "MAKE_DSYM=YES", getArchSpec( + architecture), getCCSpec(compiler), getCmdLine(dictionary)]) runBuildCommands(commands, sender=sender) diff --git a/lldb/packages/Python/lldbsuite/test/plugins/builder_freebsd.py b/lldb/packages/Python/lldbsuite/test/plugins/builder_freebsd.py index e56be429823..d9e654dc32f 100644 --- a/lldb/packages/Python/lldbsuite/test/plugins/builder_freebsd.py +++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_freebsd.py @@ -1,4 +1,10 @@ from builder_base import * -def buildDsym(sender=None, architecture=None, compiler=None, dictionary=None, clean=True): + +def buildDsym( + sender=None, + architecture=None, + compiler=None, + dictionary=None, + clean=True): 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 e56be429823..d9e654dc32f 100644 --- a/lldb/packages/Python/lldbsuite/test/plugins/builder_linux.py +++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_linux.py @@ -1,4 +1,10 @@ from builder_base import * -def buildDsym(sender=None, architecture=None, compiler=None, dictionary=None, clean=True): + +def buildDsym( + sender=None, + architecture=None, + compiler=None, + dictionary=None, + clean=True): 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 e56be429823..d9e654dc32f 100644 --- a/lldb/packages/Python/lldbsuite/test/plugins/builder_netbsd.py +++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_netbsd.py @@ -1,4 +1,10 @@ from builder_base import * -def buildDsym(sender=None, architecture=None, compiler=None, dictionary=None, clean=True): + +def buildDsym( + sender=None, + architecture=None, + compiler=None, + dictionary=None, + clean=True): 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 e56be429823..d9e654dc32f 100644 --- a/lldb/packages/Python/lldbsuite/test/plugins/builder_win32.py +++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_win32.py @@ -1,4 +1,10 @@ from builder_base import * -def buildDsym(sender=None, architecture=None, compiler=None, dictionary=None, clean=True): + +def buildDsym( + sender=None, + architecture=None, + compiler=None, + dictionary=None, + clean=True): return False |