diff options
| author | Adrian Prantl <aprantl@apple.com> | 2018-02-06 18:22:51 +0000 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2018-02-06 18:22:51 +0000 |
| commit | 332351d9b98f993e4d0eb83a98ff4d4bb619b541 (patch) | |
| tree | 342ad2040a651b28809035213b74aa0719f4910b /lldb/packages/Python/lldbsuite/test/plugins | |
| parent | 2f6412c38962193f085f7830fd54e693579a35d2 (diff) | |
| download | bcm5719-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/plugins')
| -rw-r--r-- | lldb/packages/Python/lldbsuite/test/plugins/builder_base.py | 51 | ||||
| -rw-r--r-- | lldb/packages/Python/lldbsuite/test/plugins/builder_darwin.py | 9 |
2 files changed, 35 insertions, 25 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py b/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py index 5114c067899..dd5024c9f95 100644 --- a/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py +++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py @@ -50,9 +50,10 @@ def getArchFlag(): return ("ARCHFLAG=" + archflag) if archflag else "" -def getMake(test_subdir): +def getMake(test_subdir, test_name): """Returns the invocation for GNU make. - The argument test_subdir is the relative path to the testcase.""" + The first argument is a tuple of the relative path to the testcase + and its filename stem.""" if platform.system() == "FreeBSD" or platform.system() == "NetBSD": make = "gmake" else: @@ -61,19 +62,19 @@ def getMake(test_subdir): # Construct the base make invocation. lldb_test = os.environ["LLDB_TEST"] lldb_build = os.environ["LLDB_BUILD"] - if not (lldb_test and lldb_build and test_subdir and + if not (lldb_test and lldb_build and test_subdir and test_name and (not os.path.isabs(test_subdir))): raise Exception("Could not derive test directories") - build_dir = os.path.join(lldb_build, test_subdir) - test_dir = os.path.join(lldb_test, test_subdir) + build_dir = os.path.join(lldb_build, test_subdir, test_name) + src_dir = os.path.join(lldb_test, test_subdir) # This is a bit of a hack to make inline testcases work. - makefile = os.path.join(test_dir, "Makefile") + makefile = os.path.join(src_dir, "Makefile") if not os.path.isfile(makefile): makefile = os.path.join(build_dir, "Makefile") return [make, - "VPATH="+test_dir, + "VPATH="+src_dir, "-C", build_dir, - "-I", test_dir, + "-I", src_dir, "-f", makefile] @@ -140,12 +141,13 @@ def buildDefault( compiler=None, dictionary=None, clean=True, - testdir=None): + testdir=None, + testname=None): """Build the binaries the default way.""" commands = [] if clean: - commands.append(getMake(testdir) + ["clean", getCmdLine(dictionary)]) - commands.append(getMake(testdir) + ["all", getArchSpec(architecture), + commands.append(getMake(testdir, testname) + ["clean", getCmdLine(dictionary)]) + commands.append(getMake(testdir, testname) + ["all", getArchSpec(architecture), getCCSpec(compiler), getCmdLine(dictionary)]) runBuildCommands(commands, sender=sender) @@ -160,13 +162,16 @@ def buildDwarf( compiler=None, dictionary=None, clean=True, - testdir=None): + testdir=None, + testname=None): """Build the binaries with dwarf debug info.""" commands = [] if clean: - commands.append(getMake(testdir) + ["clean", getCmdLine(dictionary)]) - commands.append(getMake(testdir) + ["MAKE_DSYM=NO", getArchSpec( - architecture), getCCSpec(compiler), getCmdLine(dictionary)]) + commands.append(getMake(testdir, testname) + + ["clean", getCmdLine(dictionary)]) + commands.append(getMake(testdir, testname) + + ["MAKE_DSYM=NO", getArchSpec(architecture), + getCCSpec(compiler), getCmdLine(dictionary)]) runBuildCommands(commands, sender=sender) # True signifies that we can handle building dwarf. @@ -179,12 +184,14 @@ def buildDwo( compiler=None, dictionary=None, clean=True, - testdir=None): + testdir=None, + testname=None): """Build the binaries with dwarf debug info.""" commands = [] if clean: - commands.append(getMake(testdir) + ["clean", getCmdLine(dictionary)]) - commands.append(getMake(testdir) + + commands.append(getMake(testdir, testname) + + ["clean", getCmdLine(dictionary)]) + commands.append(getMake(testdir, testname) + ["MAKE_DSYM=NO", "MAKE_DWO=YES", getArchSpec(architecture), getCCSpec(compiler), @@ -201,12 +208,14 @@ def buildGModules( compiler=None, dictionary=None, clean=True, - testdir=None): + testdir=None, + testname=None): """Build the binaries with dwarf debug info.""" commands = [] if clean: - commands.append(getMake(testdir) + ["clean", getCmdLine(dictionary)]) - commands.append(getMake(testdir) + + commands.append(getMake(testdir, testname) + + ["clean", getCmdLine(dictionary)]) + commands.append(getMake(testdir, testname) + ["MAKE_DSYM=NO", "MAKE_GMODULES=YES", getArchSpec(architecture), diff --git a/lldb/packages/Python/lldbsuite/test/plugins/builder_darwin.py b/lldb/packages/Python/lldbsuite/test/plugins/builder_darwin.py index d71bc3b1fee..61642bcee3e 100644 --- a/lldb/packages/Python/lldbsuite/test/plugins/builder_darwin.py +++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_darwin.py @@ -11,13 +11,14 @@ def buildDsym( compiler=None, dictionary=None, clean=True, - testdir=None): + testdir=None, + testname=None): """Build the binaries with dsym debug info.""" commands = [] - if clean: - commands.append(getMake(testdir) + ["clean", getCmdLine(dictionary)]) - commands.append(getMake(testdir) + + commands.append(getMake(testdir, testname) + + ["clean", getCmdLine(dictionary)]) + commands.append(getMake(testdir, testname) + ["MAKE_DSYM=YES", getArchSpec(architecture), getCCSpec(compiler), |

