OLD | NEW |
---|---|
1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
4 # met: | 4 # met: |
5 # | 5 # |
6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 | 88 |
89 def _RunInternal(self, jobs): | 89 def _RunInternal(self, jobs): |
90 pool = Pool(jobs) | 90 pool = Pool(jobs) |
91 test_map = {} | 91 test_map = {} |
92 # TODO(machenbach): Instead of filling the queue completely before | 92 # TODO(machenbach): Instead of filling the queue completely before |
93 # pool.imap_unordered, make this a generator that already starts testing | 93 # pool.imap_unordered, make this a generator that already starts testing |
94 # while the queue is filled. | 94 # while the queue is filled. |
95 queue = [] | 95 queue = [] |
96 queued_exception = None | 96 queued_exception = None |
97 if not self.context.no_sorting: | 97 if not self.context.no_sorting: |
98 self.tests = sorted(self.tests, key=lambda t: t.duration, reverse=True) | 98 self.tests.sort(key=lambda t: t.duration, reverse=True) |
Michael Achenbach
2014/05/28 12:03:21
Maybe move to line 68 right after the duration ini
Michael Starzinger
2014/05/28 12:13:30
Done.
| |
99 for test in self.tests: | 99 for test in self.tests: |
100 assert test.id >= 0 | 100 assert test.id >= 0 |
101 test_map[test.id] = test | 101 test_map[test.id] = test |
102 try: | 102 try: |
103 command = self.GetCommand(test) | 103 command = self.GetCommand(test) |
104 except Exception, e: | 104 except Exception, e: |
105 # If this failed, save the exception and re-raise it later (after | 105 # If this failed, save the exception and re-raise it later (after |
106 # all other tests have had a chance to run). | 106 # all other tests have had a chance to run). |
107 queued_exception = e | 107 queued_exception = e |
108 continue | 108 continue |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 test.suite.GetFlagsForTestCase(test, self.context) + | 159 test.suite.GetFlagsForTestCase(test, self.context) + |
160 self.context.extra_flags) | 160 self.context.extra_flags) |
161 return cmd | 161 return cmd |
162 | 162 |
163 | 163 |
164 class BreakNowException(Exception): | 164 class BreakNowException(Exception): |
165 def __init__(self, value): | 165 def __init__(self, value): |
166 self.value = value | 166 self.value = value |
167 def __str__(self): | 167 def __str__(self): |
168 return repr(self.value) | 168 return repr(self.value) |
OLD | NEW |