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

Unified Diff: test/mjsunit/testcfg.py

Issue 3601010: [Isolates] Allow running multiple isolates in shell and use this in tests. (Closed)
Patch Set: Created 10 years, 2 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
Index: test/mjsunit/testcfg.py
diff --git a/test/mjsunit/testcfg.py b/test/mjsunit/testcfg.py
index d8fe24d37aaebf5a9c146b6d21ab303b86febcaa..c6c6b34a5af9bc00bd304acb48118eeb9f25976f 100644
--- a/test/mjsunit/testcfg.py
+++ b/test/mjsunit/testcfg.py
@@ -38,24 +38,31 @@ SELF_SCRIPT_PATTERN = re.compile(r"//\s+Env: TEST_FILE_NAME")
class MjsunitTestCase(test.TestCase):
- def __init__(self, path, file, mode, context, config):
+ def __init__(self, path, file, mode, context, config, isolates):
super(MjsunitTestCase, self).__init__(context, path, mode)
self.file = file
self.config = config
self.self_script = False
+ self.isolates = isolates
def GetLabel(self):
return "%s %s" % (self.mode, self.GetName())
def GetName(self):
- return self.path[-1]
+ return self.path[-1] + ["", "-isolates"][self.isolates]
- def GetCommand(self):
+ def TestsIsolates(self):
+ return self.isolates
+
+ def GetVmCommand(self, source):
result = self.config.context.GetVmCommand(self, self.mode)
- source = open(self.file).read()
flags_match = FLAGS_PATTERN.search(source)
if flags_match:
result += flags_match.group(1).strip().split()
+ return result
+
+ def GetVmArguments(self, source):
+ result = []
additional_files = []
files_match = FILES_PATTERN.search(source);
# Accept several lines of 'Files:'
@@ -73,6 +80,15 @@ class MjsunitTestCase(test.TestCase):
result += [framework, self.file]
return result
+ def GetCommand(self):
+ source = open(self.file).read()
+ result = self.GetVmCommand(source)
+ result += self.GetVmArguments(source)
+ if self.isolates:
+ result.append("--isolate")
+ result += self.GetVmArguments(source)
+ return result
+
def GetSource(self):
return open(self.file).read()
@@ -116,7 +132,8 @@ class MjsunitTestConfiguration(test.TestConfiguration):
for test in all_tests:
if self.Contains(path, test):
file_path = join(self.root, reduce(join, test[1:], "") + ".js")
- result.append(MjsunitTestCase(test, file_path, mode, self.context, self))
+ result.append(MjsunitTestCase(test, file_path, mode, self.context, self, False))
+ result.append(MjsunitTestCase(test, file_path, mode, self.context, self, True))
return result
def GetBuildRequirements(self):

Powered by Google App Engine
This is Rietveld 408576698