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.reporter.compact; | 5 library test.runner.reporter.compact; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 import 'dart:isolate'; | 9 import 'dart:isolate'; |
10 | 10 |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 error.innerError is! String) { | 203 error.innerError is! String) { |
204 print(indent(terseChain(stackTrace).toString())); | 204 print(indent(terseChain(stackTrace).toString())); |
205 } | 205 } |
206 } | 206 } |
207 | 207 |
208 /// A callback called when the engine is finished running tests. | 208 /// A callback called when the engine is finished running tests. |
209 /// | 209 /// |
210 /// [success] will be `true` if all tests passed, `false` if some tests | 210 /// [success] will be `true` if all tests passed, `false` if some tests |
211 /// failed, and `null` if the engine was closed prematurely. | 211 /// failed, and `null` if the engine was closed prematurely. |
212 void _onDone(bool success) { | 212 void _onDone(bool success) { |
213 _timer.cancel(); | 213 if (_timer != null) _timer.cancel(); |
214 _timer = null; | 214 _timer = null; |
215 _stopwatch.stop(); | 215 _stopwatch.stop(); |
216 | 216 |
217 // A null success value indicates that the engine was closed before the | 217 // A null success value indicates that the engine was closed before the |
218 // tests finished running, probably because of a signal from the user. We | 218 // tests finished running, probably because of a signal from the user. We |
219 // shouldn't print summary information, we should just make sure the | 219 // shouldn't print summary information, we should just make sure the |
220 // terminal cursor is on its own line. | 220 // terminal cursor is on its own line. |
221 if (success == null) { | 221 if (success == null) { |
222 if (!_printedNewline) print(""); | 222 if (!_printedNewline) print(""); |
223 _printedNewline = true; | 223 _printedNewline = true; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 | 332 |
333 if (_printPlatform && liveTest.suite.platform != null) { | 333 if (_printPlatform && liveTest.suite.platform != null) { |
334 name = "[${liveTest.suite.platform}] $name"; | 334 name = "[${liveTest.suite.platform}] $name"; |
335 } | 335 } |
336 | 336 |
337 if (liveTest.suite is LoadSuite) name = "$_bold$_gray$name$_noColor"; | 337 if (liveTest.suite is LoadSuite) name = "$_bold$_gray$name$_noColor"; |
338 | 338 |
339 return name; | 339 return name; |
340 } | 340 } |
341 } | 341 } |
OLD | NEW |