| 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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 finally: | 607 finally: |
| 608 if file: | 608 if file: |
| 609 file.close() | 609 file.close() |
| 610 return self.config | 610 return self.config |
| 611 | 611 |
| 612 def GetBuildRequirements(self, path, context): | 612 def GetBuildRequirements(self, path, context): |
| 613 return self.GetConfiguration(context).GetBuildRequirements() | 613 return self.GetConfiguration(context).GetBuildRequirements() |
| 614 | 614 |
| 615 def AddTestsToList(self, result, current_path, path, context, mode): | 615 def AddTestsToList(self, result, current_path, path, context, mode): |
| 616 for v in VARIANT_FLAGS: | 616 for v in VARIANT_FLAGS: |
| 617 tests = self.GetConfiguration(context).ListTests(current_path, path, mode) | 617 tests = self.GetConfiguration(context).ListTests(current_path, path, mode,
v) |
| 618 for t in tests: t.variant_flags = v | 618 for t in tests: t.variant_flags = v |
| 619 result += tests | 619 result += tests |
| 620 | 620 |
| 621 | 621 |
| 622 def GetTestStatus(self, context, sections, defs): | 622 def GetTestStatus(self, context, sections, defs): |
| 623 self.GetConfiguration(context).GetTestStatus(sections, defs) | 623 self.GetConfiguration(context).GetTestStatus(sections, defs) |
| 624 | 624 |
| 625 | 625 |
| 626 class LiteralTestSuite(TestSuite): | 626 class LiteralTestSuite(TestSuite): |
| 627 | 627 |
| 628 def __init__(self, tests): | 628 def __init__(self, tests): |
| 629 super(LiteralTestSuite, self).__init__('root') | 629 super(LiteralTestSuite, self).__init__('root') |
| 630 self.tests = tests | 630 self.tests = tests |
| 631 | 631 |
| 632 def GetBuildRequirements(self, path, context): | 632 def GetBuildRequirements(self, path, context): |
| 633 (name, rest) = CarCdr(path) | 633 (name, rest) = CarCdr(path) |
| 634 result = [ ] | 634 result = [ ] |
| 635 for test in self.tests: | 635 for test in self.tests: |
| 636 if not name or name.match(test.GetName()): | 636 if not name or name.match(test.GetName()): |
| 637 result += test.GetBuildRequirements(rest, context) | 637 result += test.GetBuildRequirements(rest, context) |
| 638 return result | 638 return result |
| 639 | 639 |
| 640 def ListTests(self, current_path, path, context, mode): | 640 def ListTests(self, current_path, path, context, mode, variant_flags): |
| 641 (name, rest) = CarCdr(path) | 641 (name, rest) = CarCdr(path) |
| 642 result = [ ] | 642 result = [ ] |
| 643 for test in self.tests: | 643 for test in self.tests: |
| 644 test_name = test.GetName() | 644 test_name = test.GetName() |
| 645 if not name or name.match(test_name): | 645 if not name or name.match(test_name): |
| 646 full_path = current_path + [test_name] | 646 full_path = current_path + [test_name] |
| 647 test.AddTestsToList(result, full_path, path, context, mode) | 647 test.AddTestsToList(result, full_path, path, context, mode) |
| 648 return result | 648 return result |
| 649 | 649 |
| 650 def GetTestStatus(self, context, sections, defs): | 650 def GetTestStatus(self, context, sections, defs): |
| (...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1412 if not exists(context.GetVm(mode)): | 1412 if not exists(context.GetVm(mode)): |
| 1413 print "Can't find shell executable: '%s'" % context.GetVm(mode) | 1413 print "Can't find shell executable: '%s'" % context.GetVm(mode) |
| 1414 continue | 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) |
| 1425 if globally_unused_rules is None: | 1425 if globally_unused_rules is None: |
| 1426 globally_unused_rules = set(unused_rules) | 1426 globally_unused_rules = set(unused_rules) |
| 1427 else: | 1427 else: |
| 1428 globally_unused_rules = globally_unused_rules.intersection(unused_rules) | 1428 globally_unused_rules = globally_unused_rules.intersection(unused_rules) |
| 1429 all_cases += ShardTests(cases, options) | 1429 all_cases += ShardTests(cases, options) |
| 1430 all_unused.append(unused_rules) | 1430 all_unused.append(unused_rules) |
| 1431 | 1431 |
| 1432 if options.cat: | 1432 if options.cat: |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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()) |
| OLD | NEW |