OLD | NEW |
---|---|
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 Loading... | |
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 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1309 else: | 1310 else: |
1310 pos = value.find('@') | 1311 pos = value.find('@') |
1311 import urllib | 1312 import urllib |
1312 prefix = urllib.unquote(value[:pos]).split() | 1313 prefix = urllib.unquote(value[:pos]).split() |
1313 suffix = urllib.unquote(value[pos+1:]).split() | 1314 suffix = urllib.unquote(value[pos+1:]).split() |
1314 def ExpandCommand(args): | 1315 def ExpandCommand(args): |
1315 return prefix + args + suffix | 1316 return prefix + args + suffix |
1316 return ExpandCommand | 1317 return ExpandCommand |
1317 | 1318 |
1318 | 1319 |
1319 BUILT_IN_TESTS = ['mjsunit', 'cctest', 'message'] | 1320 BUILT_IN_TESTS = ['mjsunit', 'cctest', 'message', 'preparser'] |
1320 | 1321 |
1321 | 1322 |
1322 def GetSuites(test_root): | 1323 def GetSuites(test_root): |
1323 def IsSuite(path): | 1324 def IsSuite(path): |
1324 return isdir(path) and exists(join(path, 'testcfg.py')) | 1325 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)) ] | 1326 return [ f for f in os.listdir(test_root) if IsSuite(join(test_root, f)) ] |
1326 | 1327 |
1327 | 1328 |
1328 def FormatTime(d): | 1329 def FormatTime(d): |
1329 millis = round(d * 1000) % 1000 | 1330 millis = round(d * 1000) % 1000 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1402 root.GetTestStatus(context, sections, defs) | 1403 root.GetTestStatus(context, sections, defs) |
1403 config = Configuration(sections, defs) | 1404 config = Configuration(sections, defs) |
1404 | 1405 |
1405 # List the tests | 1406 # List the tests |
1406 all_cases = [ ] | 1407 all_cases = [ ] |
1407 all_unused = [ ] | 1408 all_unused = [ ] |
1408 unclassified_tests = [ ] | 1409 unclassified_tests = [ ] |
1409 globally_unused_rules = None | 1410 globally_unused_rules = None |
1410 for path in paths: | 1411 for path in paths: |
1411 for mode in options.mode: | 1412 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 | |
Lasse Reichstein
2011/03/31 08:10:35
Change from r7436.
This fails if only testing the
| |
1415 env = { | 1413 env = { |
1416 'mode': mode, | 1414 'mode': mode, |
1417 'system': utils.GuessOS(), | 1415 'system': utils.GuessOS(), |
1418 'arch': options.arch, | 1416 'arch': options.arch, |
1419 'simulator': options.simulator, | 1417 'simulator': options.simulator, |
1420 'crankshaft': options.crankshaft | 1418 'crankshaft': options.crankshaft |
1421 } | 1419 } |
1422 test_list = root.ListTests([], path, context, mode, []) | 1420 test_list = root.ListTests([], path, context, mode, []) |
1423 unclassified_tests += test_list | 1421 unclassified_tests += test_list |
1424 (cases, unused_rules, all_outcomes) = config.ClassifyTests(test_list, env) | 1422 (cases, unused_rules, all_outcomes) = config.ClassifyTests(test_list, env) |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1481 for entry in timed_tests[:20]: | 1479 for entry in timed_tests[:20]: |
1482 t = FormatTime(entry.duration) | 1480 t = FormatTime(entry.duration) |
1483 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) | 1481 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) |
1484 index += 1 | 1482 index += 1 |
1485 | 1483 |
1486 return result | 1484 return result |
1487 | 1485 |
1488 | 1486 |
1489 if __name__ == '__main__': | 1487 if __name__ == '__main__': |
1490 sys.exit(Main()) | 1488 sys.exit(Main()) |
OLD | NEW |