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

Side by Side Diff: tools/test.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 unified diff | Download patch
« tools/statics.whitelist ('K') | « tools/statics.whitelist ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2008 the V8 project authors. All rights reserved. 3 # Copyright 2008 the V8 project authors. All rights reserved.
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 333
334 def __init__(self, context, path, mode): 334 def __init__(self, context, path, mode):
335 self.path = path 335 self.path = path
336 self.context = context 336 self.context = context
337 self.duration = None 337 self.duration = None
338 self.mode = mode 338 self.mode = mode
339 339
340 def IsNegative(self): 340 def IsNegative(self):
341 return False 341 return False
342 342
343 def TestsIsolates(self):
344 return False
345
343 def CompareTime(self, other): 346 def CompareTime(self, other):
344 return cmp(other.duration, self.duration) 347 return cmp(other.duration, self.duration)
345 348
346 def DidFail(self, output): 349 def DidFail(self, output):
347 if output.failed is None: 350 if output.failed is None:
348 output.failed = self.IsFailureOutput(output) 351 output.failed = self.IsFailureOutput(output)
349 return output.failed 352 return output.failed
350 353
351 def IsFailureOutput(self, output): 354 def IsFailureOutput(self, output):
352 return output.exit_code != 0 355 return output.exit_code != 0
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 return None 996 return None
994 return ast 997 return ast
995 998
996 999
997 class ClassifiedTest(object): 1000 class ClassifiedTest(object):
998 1001
999 def __init__(self, case, outcomes): 1002 def __init__(self, case, outcomes):
1000 self.case = case 1003 self.case = case
1001 self.outcomes = outcomes 1004 self.outcomes = outcomes
1002 1005
1006 def TestsIsolates(self):
1007 return self.case.TestsIsolates()
1008
1003 1009
1004 class Configuration(object): 1010 class Configuration(object):
1005 """The parsed contents of a configuration file""" 1011 """The parsed contents of a configuration file"""
1006 1012
1007 def __init__(self, sections, defs): 1013 def __init__(self, sections, defs):
1008 self.sections = sections 1014 self.sections = sections
1009 self.defs = defs 1015 self.defs = defs
1010 1016
1011 def ClassifyTests(self, cases, env): 1017 def ClassifyTests(self, cases, env):
1012 sections = [s for s in self.sections if s.condition.Evaluate(env, self.defs) ] 1018 sections = [s for s in self.sections if s.condition.Evaluate(env, self.defs) ]
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 default=False, action="store_true") 1158 default=False, action="store_true")
1153 result.add_option("-j", help="The number of parallel tasks to run", 1159 result.add_option("-j", help="The number of parallel tasks to run",
1154 default=1, type="int") 1160 default=1, type="int")
1155 result.add_option("--time", help="Print timing information after running", 1161 result.add_option("--time", help="Print timing information after running",
1156 default=False, action="store_true") 1162 default=False, action="store_true")
1157 result.add_option("--suppress-dialogs", help="Suppress Windows dialogs for cra shing tests", 1163 result.add_option("--suppress-dialogs", help="Suppress Windows dialogs for cra shing tests",
1158 dest="suppress_dialogs", default=True, action="store_true") 1164 dest="suppress_dialogs", default=True, action="store_true")
1159 result.add_option("--no-suppress-dialogs", help="Display Windows dialogs for c rashing tests", 1165 result.add_option("--no-suppress-dialogs", help="Display Windows dialogs for c rashing tests",
1160 dest="suppress_dialogs", action="store_false") 1166 dest="suppress_dialogs", action="store_false")
1161 result.add_option("--shell", help="Path to V8 shell", default="shell") 1167 result.add_option("--shell", help="Path to V8 shell", default="shell")
1168 result.add_option("--isolates", help="Whether to test isolates", default=False , action="store_true")
1162 result.add_option("--store-unexpected-output", 1169 result.add_option("--store-unexpected-output",
1163 help="Store the temporary JS files from tests that fails", 1170 help="Store the temporary JS files from tests that fails",
1164 dest="store_unexpected_output", default=True, action="store_true") 1171 dest="store_unexpected_output", default=True, action="store_true")
1165 result.add_option("--no-store-unexpected-output", 1172 result.add_option("--no-store-unexpected-output",
1166 help="Deletes the temporary JS files from tests that fails", 1173 help="Deletes the temporary JS files from tests that fails",
1167 dest="store_unexpected_output", action="store_false") 1174 dest="store_unexpected_output", action="store_false")
1168 return result 1175 return result
1169 1176
1170 1177
1171 def ProcessOptions(options): 1178 def ProcessOptions(options):
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 for rule in globally_unused_rules: 1380 for rule in globally_unused_rules:
1374 print "Rule for '%s' was not used." % '/'.join([str(s) for s in rule.path] ) 1381 print "Rule for '%s' was not used." % '/'.join([str(s) for s in rule.path] )
1375 1382
1376 if options.report: 1383 if options.report:
1377 PrintReport(all_cases) 1384 PrintReport(all_cases)
1378 1385
1379 result = None 1386 result = None
1380 def DoSkip(case): 1387 def DoSkip(case):
1381 return SKIP in case.outcomes or SLOW in case.outcomes 1388 return SKIP in case.outcomes or SLOW in case.outcomes
1382 cases_to_run = [ c for c in all_cases if not DoSkip(c) ] 1389 cases_to_run = [ c for c in all_cases if not DoSkip(c) ]
1390 if not options.isolates:
1391 cases_to_run = [c for c in cases_to_run if not c.TestsIsolates()]
1383 if len(cases_to_run) == 0: 1392 if len(cases_to_run) == 0:
1384 print "No tests to run." 1393 print "No tests to run."
1385 return 0 1394 return 0
1386 else: 1395 else:
1387 try: 1396 try:
1388 start = time.time() 1397 start = time.time()
1389 if RunTestCases(cases_to_run, options.progress, options.j): 1398 if RunTestCases(cases_to_run, options.progress, options.j):
1390 result = 0 1399 result = 0
1391 else: 1400 else:
1392 result = 1 1401 result = 1
(...skipping 13 matching lines...) Expand all
1406 for entry in timed_tests[:20]: 1415 for entry in timed_tests[:20]:
1407 t = FormatTime(entry.duration) 1416 t = FormatTime(entry.duration)
1408 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) 1417 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel()))
1409 index += 1 1418 index += 1
1410 1419
1411 return result 1420 return result
1412 1421
1413 1422
1414 if __name__ == '__main__': 1423 if __name__ == '__main__':
1415 sys.exit(Main()) 1424 sys.exit(Main())
OLDNEW
« tools/statics.whitelist ('K') | « tools/statics.whitelist ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698