summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-08-19 16:04:21 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-08-19 16:04:21 +0000
commit8880ac648ceb337868b7c4949776e50f5fd1cad0 (patch)
treef0036ffea1e66f392ed2f1b9389c69aadd8f7c27 /lldb/packages/Python/lldbsuite/test
parentec4540d8a62cfef017173ce7309adcb9beca4e53 (diff)
downloadbcm5719-llvm-8880ac648ceb337868b7c4949776e50f5fd1cad0.tar.gz
bcm5719-llvm-8880ac648ceb337868b7c4949776e50f5fd1cad0.zip
[dotest] Add --dwarf-version to override the tested DWARF version.
On the matrix bot on GreenDragon [1] we want to run the test suite against different DWARF versions. The idea here is not to replace targeted tests for certain DWARF features, but rather to provide an easy way to support this configuration. [1] http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-matrix/ Differential revision: https://reviews.llvm.org/D66370 llvm-svn: 369272
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/configuration.py3
-rw-r--r--lldb/packages/Python/lldbsuite/test/decorators.py8
-rw-r--r--lldb/packages/Python/lldbsuite/test/dotest.py10
-rw-r--r--lldb/packages/Python/lldbsuite/test/dotest_args.py6
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py2
5 files changed, 22 insertions, 7 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/configuration.py b/lldb/packages/Python/lldbsuite/test/configuration.py
index 7f1d40dc590..c9ca1e46167 100644
--- a/lldb/packages/Python/lldbsuite/test/configuration.py
+++ b/lldb/packages/Python/lldbsuite/test/configuration.py
@@ -43,6 +43,9 @@ count = 1
arch = None # Must be initialized after option parsing
compiler = None # Must be initialized after option parsing
+# The overriden dwarf verison.
+dwarf_version = 0
+
# Path to the FileCheck testing tool. Not optional.
filecheck = None
diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py
index 272460fee1b..fd0aecfef50 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -194,11 +194,9 @@ def _decorateTest(mode,
macos_version[0],
macos_version[1],
platform.mac_ver()[0])))
- skip_for_dwarf_version = (
- dwarf_version is None) or (
- (self.getDebugInfo() is 'dwarf') and
- _check_expected_version(
- dwarf_version[0], dwarf_version[1], self.getDwarfVersion()))
+ skip_for_dwarf_version = (dwarf_version is None) or (
+ _check_expected_version(dwarf_version[0], dwarf_version[1],
+ self.getDwarfVersion()))
# For the test to be skipped, all specified (e.g. not None) parameters must be True.
# An unspecified parameter means "any", so those are marked skip by default. And we skip
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index ce585889f1e..7593c0da4aa 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -342,9 +342,15 @@ def parseOptionsAndInitTestdirs():
configuration.skipCategories += test_categories.validate(
args.skipCategories, False)
+ cflags_extras = ""
if args.E:
- cflags_extras = args.E
- os.environ['CFLAGS_EXTRAS'] = cflags_extras
+ cflags_extras += args.E
+
+ if args.dwarf_version:
+ configuration.dwarf_version = args.dwarf_version
+ cflags_extras += '-gdwarf-{}'.format(args.dwarf_version)
+
+ os.environ['CFLAGS_EXTRAS'] = cflags_extras
if args.d:
sys.stdout.write(
diff --git a/lldb/packages/Python/lldbsuite/test/dotest_args.py b/lldb/packages/Python/lldbsuite/test/dotest_args.py
index 4b04552d3cd..45fb42c7f4b 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -126,6 +126,12 @@ def create_parser():
action='store_true',
help='A flag to indicate an out-of-tree debug server is being used')
group.add_argument(
+ '--dwarf-version',
+ metavar='dwarf_version',
+ dest='dwarf_version',
+ type=int,
+ help='Override the DWARF version.')
+ group.add_argument(
'-s',
metavar='name',
help='Specify the name of the dir created to store the session files of tests with errored or failed status. If not specified, the test driver uses the timestamp as the session dir name')
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index dd4651c9eff..f65cc308d66 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -1290,6 +1290,8 @@ class Base(unittest2.TestCase):
def getDwarfVersion(self):
""" Returns the dwarf version generated by clang or '0'. """
+ if configuration.dwarf_version:
+ return str(configuration.dwarf_version)
if 'clang' in self.getCompiler():
try:
driver_output = check_output(
OpenPOWER on IntegriCloud