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

Side by Side Diff: tools/test.py

Issue 6691054: [Arguments] Merge (7442,7496] from bleeding_edge. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/arguments
Patch Set: Created 9 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « test/preparser/testcfg.py ('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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 pass 372 pass
373 373
374 def AfterRun(self, result): 374 def AfterRun(self, result):
375 pass 375 pass
376 376
377 def GetCustomFlags(self, mode): 377 def GetCustomFlags(self, mode):
378 return None 378 return None
379 379
380 def Run(self): 380 def Run(self):
381 self.BeforeRun() 381 self.BeforeRun()
382 result = "exception"
382 try: 383 try:
383 result = self.RunCommand(self.GetCommand()) 384 result = self.RunCommand(self.GetCommand())
384 finally: 385 finally:
385 self.AfterRun(result) 386 self.AfterRun(result)
386 return result 387 return result
387 388
388 def Cleanup(self): 389 def Cleanup(self):
389 return 390 return
390 391
391 392
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 577
577 def __init__(self, name): 578 def __init__(self, name):
578 self.name = name 579 self.name = name
579 580
580 def GetName(self): 581 def GetName(self):
581 return self.name 582 return self.name
582 583
583 584
584 # Use this to run several variants of the tests, e.g.: 585 # Use this to run several variants of the tests, e.g.:
585 # VARIANT_FLAGS = [[], ['--always_compact', '--noflush_code']] 586 # VARIANT_FLAGS = [[], ['--always_compact', '--noflush_code']]
586 VARIANT_FLAGS = [[], ['--stress-opt', '--always-opt'], ['--nocrankshaft']] 587 VARIANT_FLAGS = [[],
588 ['--stress-opt', '--always-opt'],
589 ['--nocrankshaft']]
587 590
588 591
589 class TestRepository(TestSuite): 592 class TestRepository(TestSuite):
590 593
591 def __init__(self, path): 594 def __init__(self, path):
592 normalized_path = abspath(path) 595 normalized_path = abspath(path)
593 super(TestRepository, self).__init__(basename(normalized_path)) 596 super(TestRepository, self).__init__(basename(normalized_path))
594 self.path = normalized_path 597 self.path = normalized_path
595 self.is_loaded = False 598 self.is_loaded = False
596 self.config = None 599 self.config = None
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 else: 1312 else:
1310 pos = value.find('@') 1313 pos = value.find('@')
1311 import urllib 1314 import urllib
1312 prefix = urllib.unquote(value[:pos]).split() 1315 prefix = urllib.unquote(value[:pos]).split()
1313 suffix = urllib.unquote(value[pos+1:]).split() 1316 suffix = urllib.unquote(value[pos+1:]).split()
1314 def ExpandCommand(args): 1317 def ExpandCommand(args):
1315 return prefix + args + suffix 1318 return prefix + args + suffix
1316 return ExpandCommand 1319 return ExpandCommand
1317 1320
1318 1321
1319 BUILT_IN_TESTS = ['mjsunit', 'cctest', 'message'] 1322 BUILT_IN_TESTS = ['mjsunit', 'cctest', 'message', 'preparser']
1320 1323
1321 1324
1322 def GetSuites(test_root): 1325 def GetSuites(test_root):
1323 def IsSuite(path): 1326 def IsSuite(path):
1324 return isdir(path) and exists(join(path, 'testcfg.py')) 1327 return isdir(path) and exists(join(path, 'testcfg.py'))
1325 return [ f for f in os.listdir(test_root) if IsSuite(join(test_root, f)) ] 1328 return [ f for f in os.listdir(test_root) if IsSuite(join(test_root, f)) ]
1326 1329
1327 1330
1328 def FormatTime(d): 1331 def FormatTime(d):
1329 millis = round(d * 1000) % 1000 1332 millis = round(d * 1000) % 1000
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 root.GetTestStatus(context, sections, defs) 1405 root.GetTestStatus(context, sections, defs)
1403 config = Configuration(sections, defs) 1406 config = Configuration(sections, defs)
1404 1407
1405 # List the tests 1408 # List the tests
1406 all_cases = [ ] 1409 all_cases = [ ]
1407 all_unused = [ ] 1410 all_unused = [ ]
1408 unclassified_tests = [ ] 1411 unclassified_tests = [ ]
1409 globally_unused_rules = None 1412 globally_unused_rules = None
1410 for path in paths: 1413 for path in paths:
1411 for mode in options.mode: 1414 for mode in options.mode:
1412 if not exists(context.GetVm(mode)):
1413 print "Can't find shell executable: '%s'" % context.GetVm(mode)
1414 continue
1415 env = { 1415 env = {
1416 'mode': mode, 1416 'mode': mode,
1417 'system': utils.GuessOS(), 1417 'system': utils.GuessOS(),
1418 'arch': options.arch, 1418 'arch': options.arch,
1419 'simulator': options.simulator, 1419 'simulator': options.simulator,
1420 'crankshaft': options.crankshaft 1420 'crankshaft': options.crankshaft
1421 } 1421 }
1422 test_list = root.ListTests([], path, context, mode, []) 1422 test_list = root.ListTests([], path, context, mode, [])
1423 unclassified_tests += test_list 1423 unclassified_tests += test_list
1424 (cases, unused_rules, all_outcomes) = config.ClassifyTests(test_list, env) 1424 (cases, unused_rules, all_outcomes) = config.ClassifyTests(test_list, env)
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1481 for entry in timed_tests[:20]: 1481 for entry in timed_tests[:20]:
1482 t = FormatTime(entry.duration) 1482 t = FormatTime(entry.duration)
1483 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) 1483 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel()))
1484 index += 1 1484 index += 1
1485 1485
1486 return result 1486 return result
1487 1487
1488 1488
1489 if __name__ == '__main__': 1489 if __name__ == '__main__':
1490 sys.exit(Main()) 1490 sys.exit(Main())
OLDNEW
« no previous file with comments | « test/preparser/testcfg.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698