Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(648)

Unified Diff: tools/testrunner/objects/testcase.py

Issue 1604203002: Add a library suitable for libfuzzer with a small unit test runner shell (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/testrunner/local/execution.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testrunner/objects/testcase.py
diff --git a/tools/testrunner/objects/testcase.py b/tools/testrunner/objects/testcase.py
index fa2265c0703f1fecd028fde43b988d3cc54ebf01..b91f8b4b562de54b1095414af9099281ed05b432 100644
--- a/tools/testrunner/objects/testcase.py
+++ b/tools/testrunner/objects/testcase.py
@@ -30,12 +30,13 @@ from . import output
class TestCase(object):
def __init__(self, suite, path, variant='default', flags=None,
- dependency=None):
+ dependency=None, override_shell=None):
self.suite = suite # TestSuite object
self.path = path # string, e.g. 'div-mod', 'test-api/foo'
self.flags = flags or [] # list of strings, flags specific to this test
self.variant = variant # name of the used testing variant
self.dependency = dependency # |path| for testcase that must be run first
+ self.override_shell = override_shell
self.outcomes = set([])
self.output = None
self.id = None # int, used to map result back to TestCase instance
@@ -44,7 +45,7 @@ class TestCase(object):
def CopyAddingFlags(self, variant, flags):
copy = TestCase(self.suite, self.path, variant, self.flags + flags,
- self.dependency)
+ self.dependency, self.override_shell)
copy.outcomes = self.outcomes
return copy
@@ -55,15 +56,16 @@ class TestCase(object):
"""
assert self.id is not None
return [self.suitename(), self.path, self.variant, self.flags,
- self.dependency, list(self.outcomes or []), self.id]
+ self.dependency, self.override_shell, list(self.outcomes or []),
+ self.id]
@staticmethod
def UnpackTask(task):
"""Creates a new TestCase object based on packed task data."""
# For the order of the fields, refer to PackTask() above.
- test = TestCase(str(task[0]), task[1], task[2], task[3], task[4])
- test.outcomes = set(task[5])
- test.id = task[6]
+ test = TestCase(str(task[0]), task[1], task[2], task[3], task[4], task[5])
+ test.outcomes = set(task[6])
+ test.id = task[7]
test.run = 1
return test
@@ -87,6 +89,11 @@ class TestCase(object):
def GetLabel(self):
return self.suitename() + "/" + self.suite.CommonTestName(self)
+ def shell(self):
+ if self.override_shell:
+ return self.override_shell
+ return self.suite.shell()
+
def __getstate__(self):
"""Representation to pickle test cases.
« no previous file with comments | « tools/testrunner/local/execution.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698