Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2704)

Unified Diff: bin/unittest.dart

Issue 961003005: Add a flag to control the use of color in the test runner. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Code review changes Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/src/runner/console_reporter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/unittest.dart
diff --git a/bin/unittest.dart b/bin/unittest.dart
index 9b88fdcd271f0eeabd93ade2a52380bf0746249a..6836ee4e89390c5c41c5e08834a7def908f15dac 100644
--- a/bin/unittest.dart
+++ b/bin/unittest.dart
@@ -25,6 +25,8 @@ void main(List<String> args) {
_parser.addFlag("help", abbr: "h", negatable: false,
help: "Shows this usage information.");
_parser.addOption("package-root", hide: true);
+ _parser.addFlag("color", defaultsTo: null,
+ help: 'Whether to use terminal colors.\n(auto-detected by default)');
var options;
try {
@@ -58,7 +60,9 @@ void main(List<String> args) {
throw new LoadException(path, 'Does not exist.');
}));
}).then((suites) {
- var reporter = new ConsoleReporter(flatten(suites));
+ var color = options["color"];
+ if (color == null) color = canUseSpecialChars;
+ var reporter = new ConsoleReporter(flatten(suites), color: color);
return reporter.run().then((success) {
exitCode = success ? 0 : 1;
}).whenComplete(() => reporter.close());
« no previous file with comments | « no previous file | lib/src/runner/console_reporter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698