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

Unified Diff: lib/src/backend/group.dart

Issue 1641353002: Expand the JSON reporter to enable a progress bar. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 11 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
Index: lib/src/backend/group.dart
diff --git a/lib/src/backend/group.dart b/lib/src/backend/group.dart
index c6051e86a0e29e10db86bb11ddff0426ec1ab575..146c964d4e032c8a7464e35d2cbc498d0ddc6f74 100644
--- a/lib/src/backend/group.dart
+++ b/lib/src/backend/group.dart
@@ -33,6 +33,15 @@ class Group implements GroupEntry {
/// This is `null` if no `tearDown` callbacks were declared.
final Test tearDownAll;
+ /// The number of tests (recursively) in this group.
+ int get testCount {
+ if (_testCount != null) return _testCount;
+ _testCount = entries.fold(0,
+ (count, entry) => count + (entry is Group ? entry.testCount : 1));
+ return _testCount;
+ }
+ int _testCount;
+
Group(this.name, Iterable<GroupEntry> entries, {Metadata metadata,
Test this.setUpAll, Test this.tearDownAll})
: entries = new List<GroupEntry>.unmodifiable(entries),
« json_reporter.md ('K') | « json_reporter.schema.json ('k') | lib/src/runner/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698