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 unittest.console_reporter; | 5 library unittest.console_reporter; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 | 9 |
10 import 'engine.dart'; | 10 import 'engine.dart'; |
(...skipping 11 matching lines...) Loading... |
22 /// not outputting to a terminal. | 22 /// not outputting to a terminal. |
23 final _red = getSpecial('\u001b[31m'); | 23 final _red = getSpecial('\u001b[31m'); |
24 | 24 |
25 /// The terminal escape for removing test coloring, or the empty string if this | 25 /// The terminal escape for removing test coloring, or the empty string if this |
26 /// is Windows or not outputting to a terminal. | 26 /// is Windows or not outputting to a terminal. |
27 final _noColor = getSpecial('\u001b[0m'); | 27 final _noColor = getSpecial('\u001b[0m'); |
28 | 28 |
29 /// The maximum console line length. | 29 /// The maximum console line length. |
30 /// | 30 /// |
31 /// Lines longer than this will be cropped. | 31 /// Lines longer than this will be cropped. |
32 const _lineLength = 80; | 32 const _lineLength = 100; |
33 | 33 |
34 /// A reporter that prints test results to the console in a single | 34 /// A reporter that prints test results to the console in a single |
35 /// continuously-updating line. | 35 /// continuously-updating line. |
36 class ConsoleReporter { | 36 class ConsoleReporter { |
37 /// The engine used to run the tests. | 37 /// The engine used to run the tests. |
38 final Engine _engine; | 38 final Engine _engine; |
39 | 39 |
40 /// Whether multiple test suites are being run. | 40 /// Whether multiple test suites are being run. |
41 final bool _multipleSuites; | 41 final bool _multipleSuites; |
42 | 42 |
(...skipping 179 matching lines...) Loading... |
222 | 222 |
223 /// Returns a description of [liveTest]. | 223 /// Returns a description of [liveTest]. |
224 /// | 224 /// |
225 /// This differs from the test's own description in that it may also include | 225 /// This differs from the test's own description in that it may also include |
226 /// the suite's name. | 226 /// the suite's name. |
227 String _description(LiveTest liveTest) { | 227 String _description(LiveTest liveTest) { |
228 if (_multipleSuites) return "${liveTest.suite.name}: ${liveTest.test.name}"; | 228 if (_multipleSuites) return "${liveTest.suite.name}: ${liveTest.test.name}"; |
229 return liveTest.test.name; | 229 return liveTest.test.name; |
230 } | 230 } |
231 } | 231 } |
OLD | NEW |