OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 | 9 |
10 import 'backend/metadata.dart'; | 10 import 'backend/metadata.dart'; |
11 import 'backend/suite.dart'; | |
12 import 'backend/test_platform.dart'; | 11 import 'backend/test_platform.dart'; |
13 import 'runner/application_exception.dart'; | 12 import 'runner/application_exception.dart'; |
14 import 'runner/configuration.dart'; | 13 import 'runner/configuration.dart'; |
15 import 'runner/engine.dart'; | 14 import 'runner/engine.dart'; |
16 import 'runner/load_exception.dart'; | 15 import 'runner/load_exception.dart'; |
17 import 'runner/load_suite.dart'; | 16 import 'runner/load_suite.dart'; |
18 import 'runner/loader.dart'; | 17 import 'runner/loader.dart'; |
19 import 'runner/reporter.dart'; | 18 import 'runner/reporter.dart'; |
20 import 'runner/reporter/compact.dart'; | 19 import 'runner/reporter/compact.dart'; |
21 import 'runner/reporter/expanded.dart'; | 20 import 'runner/reporter/expanded.dart'; |
| 21 import 'runner/runner_suite.dart'; |
22 import 'util/async_thunk.dart'; | 22 import 'util/async_thunk.dart'; |
23 import 'util/io.dart'; | 23 import 'util/io.dart'; |
24 import 'utils.dart'; | 24 import 'utils.dart'; |
25 | 25 |
26 /// The set of platforms for which debug flags are (currently) not supported. | 26 /// The set of platforms for which debug flags are (currently) not supported. |
27 final _debugUnsupportedPlatforms = new Set.from( | 27 final _debugUnsupportedPlatforms = new Set.from( |
28 [TestPlatform.vm, TestPlatform.phantomJS, TestPlatform.contentShell]); | 28 [TestPlatform.vm, TestPlatform.phantomJS, TestPlatform.contentShell]); |
29 | 29 |
30 /// A class that loads and runs tests based on a [Configuration]. | 30 /// A class that loads and runs tests based on a [Configuration]. |
31 /// | 31 /// |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 _engine.run() | 214 _engine.run() |
215 ]); | 215 ]); |
216 return results.last; | 216 return results.last; |
217 } | 217 } |
218 | 218 |
219 /// Pauses the engine and the reporter so that the user can set breakpoints as | 219 /// Pauses the engine and the reporter so that the user can set breakpoints as |
220 /// necessary. | 220 /// necessary. |
221 /// | 221 /// |
222 /// This is a no-op for test suites that aren't on platforms where debugging | 222 /// This is a no-op for test suites that aren't on platforms where debugging |
223 /// is supported. | 223 /// is supported. |
224 Future _pause(Suite suite) async { | 224 Future _pause(RunnerSuite suite) async { |
225 if (suite.platform == null) return; | 225 if (suite.platform == null) return; |
226 if (_debugUnsupportedPlatforms.contains(suite.platform)) return; | 226 if (_debugUnsupportedPlatforms.contains(suite.platform)) return; |
227 | 227 |
228 try { | 228 try { |
229 _reporter.pause(); | 229 _reporter.pause(); |
230 | 230 |
231 var bold = _configuration.color ? '\u001b[1m' : ''; | 231 var bold = _configuration.color ? '\u001b[1m' : ''; |
232 var noColor = _configuration.color ? '\u001b[0m' : ''; | 232 var noColor = _configuration.color ? '\u001b[0m' : ''; |
233 print(''); | 233 print(''); |
234 print(wordWrap( | 234 print(wordWrap( |
235 "${bold}The test runner is paused.${noColor} Open the dev console in " | 235 "${bold}The test runner is paused.${noColor} Open the dev console in " |
236 "${suite.platform} and set breakpoints. Once you're finished, " | 236 "${suite.platform} and set breakpoints. Once you're finished, " |
237 "return to this terminal and press Enter.")); | 237 "return to this terminal and press Enter.")); |
238 | 238 |
239 // TODO(nweiz): Display something in the paused browsers indicating that | 239 // TODO(nweiz): Display something in the paused browsers indicating that |
240 // they're paused. | 240 // they're paused. |
241 | 241 |
242 await stdinLines.next; | 242 await stdinLines.next; |
243 } finally { | 243 } finally { |
244 _reporter.resume(); | 244 _reporter.resume(); |
245 } | 245 } |
246 } | 246 } |
247 } | 247 } |
OLD | NEW |