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

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

Issue 983573002: Add support for running browser tests to the test runner. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: 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 | « lib/src/runner/reporter/compact.dart ('k') | lib/src/runner/test_platform.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/reporter/no_io_compact.dart
diff --git a/lib/src/runner/reporter/no_io_compact.dart b/lib/src/runner/reporter/no_io_compact.dart
index a947730eb8c50fc4c32cd7d2f4d956b4fad9150a..91dae81d41f7f4dedcc19bfa5b27abf1e5410114 100644
--- a/lib/src/runner/reporter/no_io_compact.dart
+++ b/lib/src/runner/reporter/no_io_compact.dart
@@ -39,8 +39,11 @@ class NoIoCompactReporter {
/// The engine used to run the tests.
final Engine _engine;
- /// Whether multiple test suites are being run.
- final bool _multipleSuites;
+ /// Whether multiple test files are being run.
+ final bool _multiplePaths;
+
+ /// Whether tests are being run on multiple platforms.
+ final bool _multiplePlatforms;
/// A stopwatch that tracks the duration of the full run.
final _stopwatch = new Stopwatch();
@@ -65,7 +68,9 @@ class NoIoCompactReporter {
/// If [color] is `true`, this will use terminal colors; if it's `false`, it
/// won't.
NoIoCompactReporter(Iterable<Suite> suites, {bool color: true})
- : _multipleSuites = suites.length > 1,
+ : _multiplePaths = suites.map((suite) => suite.path).toSet().length > 1,
+ _multiplePlatforms =
+ suites.map((suite) => suite.platform).toSet().length > 1,
_engine = new Engine(suites),
_green = color ? '\u001b[32m' : '',
_red = color ? '\u001b[31m' : '',
@@ -184,7 +189,16 @@ class NoIoCompactReporter {
/// This differs from the test's own description in that it may also include
/// the suite's name.
String _description(LiveTest liveTest) {
- if (_multipleSuites) return "${liveTest.suite.name}: ${liveTest.test.name}";
- return liveTest.test.name;
+ var name = liveTest.test.name;
+
+ if (_multiplePaths && liveTest.suite.path != null) {
+ name = "${liveTest.suite.path}: $name";
+ }
+
+ if (_multiplePlatforms && liveTest.suite.platform != null) {
+ name = "[$liveTest.suite.platform] $name";
+ }
+
+ return name;
}
}
« no previous file with comments | « lib/src/runner/reporter/compact.dart ('k') | lib/src/runner/test_platform.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698