Skip to content

Commit

Permalink
tools: remove unused code from test.py
Browse files Browse the repository at this point in the history
PR-URL: #12806
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Trott authored and gibfahn committed Jun 20, 2017
1 parent 0dff20a commit 7d441d7
Showing 1 changed file with 5 additions and 44 deletions.
49 changes: 5 additions & 44 deletions tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ def __init__(self, cases, flaky_tests_mode):
self.failed = [ ]
self.flaky_failed = [ ]
self.crashed = 0
self.flaky_crashed = 0
self.lock = threading.Lock()
self.shutdown_event = threading.Event()

Expand Down Expand Up @@ -155,8 +154,6 @@ def RunSingle(self, parallel, thread_id):
if output.UnexpectedOutput():
if FLAKY in output.test.outcomes and self.flaky_tests_mode == DONTCARE:
self.flaky_failed.append(output)
if output.HasCrashed():
self.flaky_crashed += 1
else:
self.failed.append(output)
if output.HasCrashed():
Expand Down Expand Up @@ -541,9 +538,6 @@ def UnexpectedOutput(self):
outcome = PASS
return not outcome in self.test.outcomes

def HasPreciousOutput(self):
return self.UnexpectedOutput() and self.store_unexpected_output

def HasCrashed(self):
if utils.IsWindows():
return 0x80000000 & self.output.exit_code and not (0x3FFFFF00 & self.output.exit_code)
Expand Down Expand Up @@ -770,11 +764,6 @@ def GetName(self):
return self.name


# Use this to run several variants of the tests, e.g.:
# VARIANT_FLAGS = [[], ['--always_compact', '--noflush_code']]
VARIANT_FLAGS = [[]]


class TestRepository(TestSuite):

def __init__(self, path):
Expand All @@ -793,10 +782,6 @@ def GetConfiguration(self, context):
(file, pathname, description) = imp.find_module('testcfg', [ self.path ])
module = imp.load_module('testcfg', file, pathname, description)
self.config = module.GetConfiguration(context, self.path)
if hasattr(self.config, 'additional_flags'):
self.config.additional_flags += context.node_args
else:
self.config.additional_flags = context.node_args
finally:
if file:
file.close()
Expand All @@ -806,13 +791,11 @@ def GetBuildRequirements(self, path, context):
return self.GetConfiguration(context).GetBuildRequirements()

def AddTestsToList(self, result, current_path, path, context, arch, mode):
for v in VARIANT_FLAGS:
tests = self.GetConfiguration(context).ListTests(current_path, path,
arch, mode)
for t in tests: t.variant_flags = v
result += tests
for i in range(1, context.repeat):
result += copy.deepcopy(tests)
tests = self.GetConfiguration(context).ListTests(current_path, path,
arch, mode)
result += tests
for i in range(1, context.repeat):
result += copy.deepcopy(tests)

def GetTestStatus(self, context, sections, defs):
self.GetConfiguration(context).GetTestStatus(sections, defs)
Expand Down Expand Up @@ -848,12 +831,6 @@ def GetTestStatus(self, context, sections, defs):
test.GetTestStatus(context, sections, defs)


SUFFIX = {
'debug' : '_g',
'release' : '' }
FLAGS = {
'debug' : ['--enable-slow-asserts', '--debug-code', '--verify-heap'],
'release' : []}
TIMEOUT_SCALEFACTOR = {
'armv6' : { 'debug' : 12, 'release' : 3 }, # The ARM buildbots are slow.
'arm' : { 'debug' : 8, 'release' : 2 },
Expand All @@ -870,7 +847,6 @@ def __init__(self, workspace, buildspace, verbose, vm, args, expect_fail,
self.workspace = workspace
self.buildspace = buildspace
self.verbose = verbose
self.vm_root = vm
self.node_args = args
self.expect_fail = expect_fail
self.timeout = timeout
Expand Down Expand Up @@ -899,9 +875,6 @@ def GetVm(self, arch, mode):

return name

def GetVmFlags(self, testcase, mode):
return testcase.variant_flags + FLAGS[mode]

def GetTimeout(self, mode):
return self.timeout * TIMEOUT_SCALEFACTOR[ARCH_GUESS or 'ia32'][mode]

Expand Down Expand Up @@ -986,18 +959,6 @@ def IsEmpty(self):
return len(self.elms) == 0


class Everything(Set):

def Intersect(self, that):
return that

def Union(self, that):
return self

def IsEmpty(self):
return False


class Nothing(Set):

def Intersect(self, that):
Expand Down

0 comments on commit 7d441d7

Please sign in to comment.