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

Unified Diff: lib/src/runner/reporter/compact.dart

Issue 1062813006: Add the ability to run test suites in parallel. (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 | « lib/src/runner/engine.dart ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/reporter/compact.dart
diff --git a/lib/src/runner/reporter/compact.dart b/lib/src/runner/reporter/compact.dart
index b24136aff21960904527057631e5fa2ee3dd55ff..9099a3d390f7f80eb3264eddf5b9f5c69f1cc530 100644
--- a/lib/src/runner/reporter/compact.dart
+++ b/lib/src/runner/reporter/compact.dart
@@ -51,6 +51,9 @@ class CompactReporter {
/// The set of tests that have completed and been marked as failing or error.
final _failed = new Set<LiveTest>();
+ /// The set of tests that are still running.
+ final _active = new List<LiveTest>();
+
/// Whether [close] has been called.
bool _closed = false;
@@ -70,27 +73,37 @@ class CompactReporter {
///
/// If [color] is `true`, this will use terminal colors; if it's `false`, it
/// won't.
- CompactReporter(Iterable<Suite> suites, {bool color: true})
+ CompactReporter(Iterable<Suite> suites, {int concurrency, bool color: true})
: _multiplePaths = suites.map((suite) => suite.path).toSet().length > 1,
_multiplePlatforms =
suites.map((suite) => suite.platform).toSet().length > 1,
- _engine = new Engine(suites),
+ _engine = new Engine(suites, concurrency: concurrency),
_green = color ? '\u001b[32m' : '',
_red = color ? '\u001b[31m' : '',
_noColor = color ? '\u001b[0m' : '' {
_engine.onTestStarted.listen((liveTest) {
- _progressLine(_description(liveTest));
+ if (_active.isEmpty) _progressLine(_description(liveTest));
+ _active.add(liveTest);
_printedNewline = false;
liveTest.onStateChange.listen((state) {
if (state.status != Status.complete) return;
+ _active.remove(liveTest);
if (state.result == Result.success) {
_passed.add(liveTest);
} else {
_passed.remove(liveTest);
_failed.add(liveTest);
}
- _progressLine(_description(liveTest));
+
+ // Always display the name of the oldest active test, unless testing is
+ // finished in which case display the last test to complete.
+ if (_active.isEmpty) {
+ _progressLine(_description(liveTest));
+ } else {
+ _progressLine(_description(_active.first));
+ }
+
_printedNewline = false;
});
« no previous file with comments | « lib/src/runner/engine.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698