diff options
Diffstat (limited to 'deps/v8/tools/testrunner/testproc/loader.py')
-rw-r--r-- | deps/v8/tools/testrunner/testproc/loader.py | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/deps/v8/tools/testrunner/testproc/loader.py b/deps/v8/tools/testrunner/testproc/loader.py index 0a3d0df1b3..f4afeae0e0 100644 --- a/deps/v8/tools/testrunner/testproc/loader.py +++ b/deps/v8/tools/testrunner/testproc/loader.py @@ -9,19 +9,34 @@ class LoadProc(base.TestProc): """First processor in the chain that passes all tests to the next processor. """ - def load_tests(self, tests): - loaded = set() - for test in tests: - if test.procid in loaded: - print 'Warning: %s already obtained' % test.procid - continue + def __init__(self, tests): + super(LoadProc, self).__init__() - loaded.add(test.procid) - self._send_test(test) + self.tests = tests + + def load_initial_tests(self, initial_batch_size): + """ + Args: + exec_proc: execution processor that the tests are being loaded into + initial_batch_size: initial number of tests to load + """ + loaded_tests = 0 + while loaded_tests < initial_batch_size: + try: + t = next(self.tests) + except StopIteration: + return + + if self._send_test(t): + loaded_tests += 1 def next_test(self, test): assert False, 'Nothing can be connected to the LoadProc' def result_for(self, test, result): - # Ignore all results. - pass + try: + while not self._send_test(next(self.tests)): + pass + except StopIteration: + # No more tests to load. + pass |