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

Unified Diff: lib/src/executable.dart

Issue 1100873005: Add a --reporter flag and expose the expanded reporter. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 5 years, 8 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 | « CHANGELOG.md ('k') | lib/src/runner/engine.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/executable.dart
diff --git a/lib/src/executable.dart b/lib/src/executable.dart
index 7b0e6c72f74f22843e5be6e8fb6c8cbedc31dae2..a9d9ccfc571d3a73d70aa4b53362b13e2b640188 100644
--- a/lib/src/executable.dart
+++ b/lib/src/executable.dart
@@ -17,6 +17,7 @@ import 'package:yaml/yaml.dart';
import 'backend/test_platform.dart';
import 'runner/reporter/compact.dart';
+import 'runner/reporter/expanded.dart';
import 'runner/application_exception.dart';
import 'runner/load_exception.dart';
import 'runner/load_exception_suite.dart';
@@ -105,6 +106,15 @@ void main(List<String> args) {
help: 'The port of a pub serve instance serving "test/".',
hide: !supportsPubServe,
valueHelp: 'port');
+ _parser.addOption("reporter",
+ abbr: 'r',
+ help: 'The runner used to print test results.',
+ allowed: ['compact', 'expanded'],
+ defaultsTo: Platform.isWindows ? 'expanded' : 'compact',
+ allowedHelp: {
+ 'compact': 'A single line, updated continuously.',
+ 'expanded': 'A separate line for each update.'
+ });
_parser.addFlag("color", defaultsTo: null,
help: 'Whether to use terminal colors.\n(auto-detected by default)');
@@ -237,8 +247,11 @@ transformers:
}
}
- var reporter = new CompactReporter(flatten(suites),
- concurrency: concurrency, color: color);
+ var reporter = options["reporter"] == "compact"
+ ? new CompactReporter(flatten(suites),
+ concurrency: concurrency, color: color)
+ : new ExpandedReporter(flatten(suites),
+ concurrency: concurrency, color: color);
// Override the signal handler to close [reporter]. [loader] will still be
// closed in the [whenComplete] below.
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/runner/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698