OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
6 * Classes and methods for executing tests. | 6 * Classes and methods for executing tests. |
7 * | 7 * |
8 * This module includes: | 8 * This module includes: |
9 * - Managing parallel execution of tests, including timeout checks. | 9 * - Managing parallel execution of tests, including timeout checks. |
10 * - Evaluating the output of each test as pass/fail/crash/timeout. | 10 * - Evaluating the output of each test as pass/fail/crash/timeout. |
(...skipping 2540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2551 | 2551 |
2552 BrowserTest browserTest; | 2552 BrowserTest browserTest; |
2553 if (browserCommand is BrowserHtmlTestCommand) { | 2553 if (browserCommand is BrowserHtmlTestCommand) { |
2554 browserTest = new HtmlTest(browserCommand.url, callback, timeout, | 2554 browserTest = new HtmlTest(browserCommand.url, callback, timeout, |
2555 browserCommand.expectedMessages); | 2555 browserCommand.expectedMessages); |
2556 } else { | 2556 } else { |
2557 browserTest = new BrowserTest(browserCommand.url, callback, timeout); | 2557 browserTest = new BrowserTest(browserCommand.url, callback, timeout); |
2558 } | 2558 } |
2559 _getBrowserTestRunner(browserCommand.browser, browserCommand.configuration) | 2559 _getBrowserTestRunner(browserCommand.browser, browserCommand.configuration) |
2560 .then((testRunner) { | 2560 .then((testRunner) { |
2561 testRunner.queueTest(browserTest); | 2561 testRunner.enqueueTest(browserTest); |
2562 }); | 2562 }); |
2563 | 2563 |
2564 return completer.future; | 2564 return completer.future; |
2565 } | 2565 } |
2566 | 2566 |
2567 Future<BrowserTestRunner> _getBrowserTestRunner(String browser, | 2567 Future<BrowserTestRunner> _getBrowserTestRunner(String browser, |
2568 Map configuration) { | 2568 Map configuration) async { |
2569 var localIp = globalConfiguration['local_ip']; | 2569 var localIp = globalConfiguration['local_ip']; |
2570 var num_browsers = maxBrowserProcesses; | |
2571 if (_browserTestRunners[configuration] == null) { | 2570 if (_browserTestRunners[configuration] == null) { |
2572 var testRunner = new BrowserTestRunner( | 2571 var testRunner = new BrowserTestRunner( |
2573 configuration, localIp, browser, num_browsers); | 2572 configuration, localIp, browser, maxBrowserProcesses); |
2574 if (globalConfiguration['verbose']) { | 2573 if (globalConfiguration['verbose']) { |
2575 testRunner.logger = DebugLogger.info; | 2574 testRunner.logger = DebugLogger.info; |
2576 } | 2575 } |
2577 _browserTestRunners[configuration] = testRunner; | 2576 _browserTestRunners[configuration] = testRunner; |
2578 return testRunner.start().then((started) { | 2577 await testRunner.start(); |
2579 if (started) { | |
2580 return testRunner; | |
2581 } | |
2582 print("Issue starting browser test runner"); | |
2583 io.exit(1); | |
2584 }); | |
2585 } | 2578 } |
2586 return new Future.value(_browserTestRunners[configuration]); | 2579 return _browserTestRunners[configuration]; |
2587 } | 2580 } |
2588 } | 2581 } |
2589 | 2582 |
2590 class RecordingCommandExecutor implements CommandExecutor { | 2583 class RecordingCommandExecutor implements CommandExecutor { |
2591 TestCaseRecorder _recorder; | 2584 TestCaseRecorder _recorder; |
2592 | 2585 |
2593 RecordingCommandExecutor(Path path) | 2586 RecordingCommandExecutor(Path path) |
2594 : _recorder = new TestCaseRecorder(path); | 2587 : _recorder = new TestCaseRecorder(path); |
2595 | 2588 |
2596 Future<CommandOutput> runCommand(node, ProcessCommand command, int timeout) { | 2589 Future<CommandOutput> runCommand(node, ProcessCommand command, int timeout) { |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2957 } | 2950 } |
2958 } | 2951 } |
2959 | 2952 |
2960 void eventAllTestsDone() { | 2953 void eventAllTestsDone() { |
2961 for (var listener in _eventListener) { | 2954 for (var listener in _eventListener) { |
2962 listener.allDone(); | 2955 listener.allDone(); |
2963 } | 2956 } |
2964 _allDone(); | 2957 _allDone(); |
2965 } | 2958 } |
2966 } | 2959 } |
OLD | NEW |