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

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

Issue 2091173002: Add metadata to messages emitted by live tests. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 6 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/remote_listener.dart ('k') | lib/src/runner/reporter/expanded.dart » ('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 45e15340cd991ff58ef6005048590e224df733e9..0222e71a960e14bfd640bc086a46ec0df1e9fa1e 100644
--- a/lib/src/runner/reporter/compact.dart
+++ b/lib/src/runner/reporter/compact.dart
@@ -7,6 +7,7 @@ import 'dart:io';
import 'dart:isolate';
import '../../backend/live_test.dart';
+import '../../backend/message.dart';
import '../../backend/state.dart';
import '../../utils.dart';
import '../../utils.dart' as utils;
@@ -199,12 +200,14 @@ class CompactReporter implements Reporter {
_subscriptions.add(liveTest.onError.listen((error) =>
_onError(liveTest, error.error, error.stackTrace)));
- _subscriptions.add(liveTest.onPrint.listen((line) {
+ _subscriptions.add(liveTest.onMessage.listen((message) {
_progressLine(_description(liveTest), truncate: false);
if (!_printedNewline) print('');
_printedNewline = true;
- print(line);
+ var text = message.text;
+ if (message.type == MessageType.skip) text = ' $_yellow$text$_noColor';
+ print(text);
}));
}
@@ -212,20 +215,12 @@ class CompactReporter implements Reporter {
void _onStateChange(LiveTest liveTest, State state) {
if (state.status != Status.complete) return;
- if (state.result == Result.skipped &&
- liveTest.test.metadata.skipReason != null) {
+ // Always display the name of the oldest active test, unless testing
+ // is finished in which case display the last test to complete.
+ if (_engine.active.isEmpty) {
_progressLine(_description(liveTest));
- print('');
- print(indent('${_yellow}Skip: ${liveTest.test.metadata.skipReason}'
- '$_noColor'));
} else {
- // Always display the name of the oldest active test, unless testing
- // is finished in which case display the last test to complete.
- if (_engine.active.isEmpty) {
- _progressLine(_description(liveTest));
- } else {
- _progressLine(_description(_engine.active.first));
- }
+ _progressLine(_description(_engine.active.first));
}
}
« no previous file with comments | « lib/src/runner/remote_listener.dart ('k') | lib/src/runner/reporter/expanded.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698