From 606e3a5221ec611a2f5da6d9a4961e8e2199f9d2 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Tue, 8 Dec 2015 01:15:30 +0000 Subject: Get rid of global variables in dotest.py This moves all the global variables into a separate module called `configuration`. This has a number of advantages: 1. Configuration data is centrally maintained so it's easy to get a high level overview of what configuration data the test suite makes use of. 2. The method of sharing configuration data among different parts of the test suite becomes standardized. Previously we would put some things into the `lldb` module, some things into the `lldbtest_config` module, and some things would not get shared. Now everything is shared through one module and is available to the entire test suite. 3. It opens the door to moving some of the initialization code into the `configuration` module, simplifying the implementation of `dotest.py`. There are a few stragglers that didn't get converted over to using the `configuration` module in this patch, because it would have grown the size of the patch unnecessarily. This includes everything currently in the `lldbtest_config` module, as well as the `lldb.remote_platform` variable. We can address these in the future. llvm-svn: 254982 --- .../Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py | 3 ++- .../Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/benchmarks/expression') diff --git a/lldb/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py b/lldb/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py index eca768afa2f..966b7363c4b 100644 --- a/lldb/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py +++ b/lldb/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py @@ -6,6 +6,7 @@ from __future__ import print_function import os, sys import lldb +from lldbsuite.test import configuration from lldbsuite.test.lldbbench import * class ExpressionEvaluationCase(BenchBase): @@ -16,7 +17,7 @@ class ExpressionEvaluationCase(BenchBase): BenchBase.setUp(self) self.source = 'main.cpp' self.line_to_break = line_number(self.source, '// Set breakpoint here.') - self.count = lldb.bmIterationCount + self.count = configuration.bmIterationCount if self.count <= 0: self.count = 25 diff --git a/lldb/packages/Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py b/lldb/packages/Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py index fb629ff27bb..223561eb420 100644 --- a/lldb/packages/Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py +++ b/lldb/packages/Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py @@ -6,6 +6,7 @@ from __future__ import print_function import os, sys import lldb +from lldbsuite.test import configuration from lldbsuite.test.lldbbench import * class RepeatedExprsCase(BenchBase): @@ -18,7 +19,7 @@ class RepeatedExprsCase(BenchBase): self.line_to_break = line_number(self.source, '// Set breakpoint here.') self.lldb_avg = None self.gdb_avg = None - self.count = lldb.bmIterationCount + self.count = configuration.bmIterationCount if self.count <= 0: self.count = 100 -- cgit v1.2.3