| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 int _lastProgressFailed; | 79 int _lastProgressFailed; |
| 80 | 80 |
| 81 /// The message printed for the last progress notification. | 81 /// The message printed for the last progress notification. |
| 82 String _lastProgressMessage; | 82 String _lastProgressMessage; |
| 83 | 83 |
| 84 // Whether a newline has been printed since the last progress line. | 84 // Whether a newline has been printed since the last progress line. |
| 85 var _printedNewline = true; | 85 var _printedNewline = true; |
| 86 | 86 |
| 87 /// Creates a [ConsoleReporter] that will run all tests in [suites]. | 87 /// Creates a [ConsoleReporter] that will run all tests in [suites]. |
| 88 /// | 88 /// |
| 89 /// If [color] is `true`, this will use terminal colors; if it's `false`, it | 89 /// [concurrency] controls how many suites are run at once. If [color] is |
| 90 /// won't. | 90 /// `true`, this will use terminal colors; if it's `false`, it won't. |
| 91 CompactReporter(Iterable<Suite> suites, {int concurrency, bool color: true}) | 91 CompactReporter(Iterable<Suite> suites, {int concurrency, bool color: true}) |
| 92 : _multiplePaths = suites.map((suite) => suite.path).toSet().length > 1, | 92 : _multiplePaths = suites.map((suite) => suite.path).toSet().length > 1, |
| 93 _multiplePlatforms = | 93 _multiplePlatforms = |
| 94 suites.map((suite) => suite.platform).toSet().length > 1, | 94 suites.map((suite) => suite.platform).toSet().length > 1, |
| 95 _engine = new Engine(suites, concurrency: concurrency), | 95 _engine = new Engine(suites, concurrency: concurrency), |
| 96 _color = color, | 96 _color = color, |
| 97 _green = color ? '\u001b[32m' : '', | 97 _green = color ? '\u001b[32m' : '', |
| 98 _red = color ? '\u001b[31m' : '', | 98 _red = color ? '\u001b[31m' : '', |
| 99 _yellow = color ? '\u001b[33m' : '', | 99 _yellow = color ? '\u001b[33m' : '', |
| 100 _noColor = color ? '\u001b[0m' : '' { | 100 _noColor = color ? '\u001b[0m' : '' { |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 name = "${liveTest.suite.path}: $name"; | 292 name = "${liveTest.suite.path}: $name"; |
| 293 } | 293 } |
| 294 | 294 |
| 295 if (_multiplePlatforms && liveTest.suite.platform != null) { | 295 if (_multiplePlatforms && liveTest.suite.platform != null) { |
| 296 name = "[${liveTest.suite.platform}] $name"; | 296 name = "[${liveTest.suite.platform}] $name"; |
| 297 } | 297 } |
| 298 | 298 |
| 299 return name; | 299 return name; |
| 300 } | 300 } |
| 301 } | 301 } |
| OLD | NEW |