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. |
/// |