| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #library("test_runner"); | 5 #library("test_runner"); |
| 6 | 6 |
| 7 #import("status_file_parser.dart"); | 7 #import("status_file_parser.dart"); |
| 8 #import("test_progress.dart"); | 8 #import("test_progress.dart"); |
| 9 #import("test_suite.dart"); | 9 #import("test_suite.dart"); |
| 10 | 10 |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 class ProcessQueue { | 320 class ProcessQueue { |
| 321 int _numProcesses = 0; | 321 int _numProcesses = 0; |
| 322 int _activeTestListers = 0; | 322 int _activeTestListers = 0; |
| 323 int _maxProcesses; | 323 int _maxProcesses; |
| 324 bool _verbose; | 324 bool _verbose; |
| 325 Function _enqueueMoreWork; | 325 Function _enqueueMoreWork; |
| 326 Queue<TestCase> _tests; | 326 Queue<TestCase> _tests; |
| 327 ProgressIndicator _progress; | 327 ProgressIndicator _progress; |
| 328 // For dartc batch processing we keep a list of batch processes. | 328 // For dartc batch processing we keep a list of batch processes. |
| 329 List<DartcBatchRunnerProcess> _batchProcesses; | 329 List<DartcBatchRunnerProcess> _batchProcesses; |
| 330 // Cache information about test cases per test suite. For multiple |
| 331 // configurations there is no need to repeatedly search the file |
| 332 // system, generate tests, and search test files for options. |
| 333 Map<String, List<TestInformation>> _testCache; |
| 330 | 334 |
| 331 ProcessQueue(int this._maxProcesses, | 335 ProcessQueue(int this._maxProcesses, |
| 332 String progress, | 336 String progress, |
| 333 bool this._verbose, | 337 bool this._verbose, |
| 334 Date startTime, | 338 Date startTime, |
| 335 bool printTiming, | 339 bool printTiming, |
| 336 Function this._enqueueMoreWork) | 340 Function this._enqueueMoreWork) |
| 337 : _tests = new Queue<TestCase>(), | 341 : _tests = new Queue<TestCase>(), |
| 338 _progress = new ProgressIndicator.fromName(progress, | 342 _progress = new ProgressIndicator.fromName(progress, |
| 339 startTime, | 343 startTime, |
| 340 printTiming), | 344 printTiming), |
| 341 _batchProcesses = new List<DartcBatchRunnerProcess>() { | 345 _batchProcesses = new List<DartcBatchRunnerProcess>(), |
| 346 _testCache = new Map<String, List<TestInformation>>() { |
| 342 if (!_enqueueMoreWork(this)) _progress.allDone(); | 347 if (!_enqueueMoreWork(this)) _progress.allDone(); |
| 343 } | 348 } |
| 344 | 349 |
| 345 void addTestSuite(TestSuite testSuite) { | 350 void addTestSuite(TestSuite testSuite) { |
| 346 _activeTestListers++; | 351 _activeTestListers++; |
| 347 testSuite.forEachTest(_runTest, _testListerDone); | 352 testSuite.forEachTest(_runTest, _testCache, _testListerDone); |
| 348 } | 353 } |
| 349 | 354 |
| 350 void _testListerDone() { | 355 void _testListerDone() { |
| 351 _activeTestListers--; | 356 _activeTestListers--; |
| 352 _checkDone(); | 357 _checkDone(); |
| 353 } | 358 } |
| 354 | 359 |
| 355 void _checkDone() { | 360 void _checkDone() { |
| 356 // When there are no more active test listers ask for more work | 361 // When there are no more active test listers ask for more work |
| 357 // from process queue users. | 362 // from process queue users. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 if (test.configuration['component'] == 'dartc') { | 412 if (test.configuration['component'] == 'dartc') { |
| 408 _ensureDartcBatchRunnersStarted(test.executablePath); | 413 _ensureDartcBatchRunnersStarted(test.executablePath); |
| 409 _getDartcBatchRunnerProcess().startTest(test); | 414 _getDartcBatchRunnerProcess().startTest(test); |
| 410 } else { | 415 } else { |
| 411 new RunningProcess(test).start(); | 416 new RunningProcess(test).start(); |
| 412 } | 417 } |
| 413 _numProcesses++; | 418 _numProcesses++; |
| 414 } | 419 } |
| 415 } | 420 } |
| 416 } | 421 } |
| OLD | NEW |