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

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

Issue 1036943002: Add a testOn parameter to test() and group(). (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Created 5 years, 9 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/backend/declarer.dart ('k') | lib/src/backend/invoker.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/backend/group.dart
diff --git a/lib/src/backend/group.dart b/lib/src/backend/group.dart
index 8223d4ca1ffb4b4a896548a0e5271f85083c2541..956b744a0c9d3555f7f8def5f104845a44550f9e 100644
--- a/lib/src/backend/group.dart
+++ b/lib/src/backend/group.dart
@@ -7,6 +7,7 @@ library unittest.backend.group;
import 'dart:async';
import '../utils.dart';
+import 'metadata.dart';
/// A group contains multiple tests and subgroups.
///
@@ -21,6 +22,13 @@ class Group {
/// group.
final String _description;
+ /// The metadata for this group, including the metadata of any parent groups.
+ Metadata get metadata {
+ if (parent == null) return _metadata;
+ return parent.metadata.merge(_metadata);
+ }
+ final Metadata _metadata;
+
/// The set-up function for this group, or `null`.
AsyncFunction setUp;
@@ -40,9 +48,9 @@ class Group {
///
/// This is the implicit group that exists outside of any calls to `group()`.
Group.root()
- : this(null, null);
+ : this(null, null, new Metadata());
- Group(this.parent, this._description);
+ Group(this.parent, this._description, this._metadata);
/// Run the set-up functions for this and any parent groups.
///
« no previous file with comments | « lib/src/backend/declarer.dart ('k') | lib/src/backend/invoker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698