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

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

Issue 1400743002: Add support for setUpAll and tearDownAll. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 years, 2 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/runner/browser/browser_manager.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 bcc7e7785bf3f9cbf04aeca65265f320482a2b14..dc7e6bd38c5f8f3ee607010b02c76f5568509a1b 100644
--- a/lib/src/backend/group.dart
+++ b/lib/src/backend/group.dart
@@ -25,7 +25,18 @@ class Group implements GroupEntry {
Group.root(Iterable<GroupEntry> entries, {Metadata metadata})
: this(null, entries, metadata: metadata);
- Group(this.name, Iterable<GroupEntry> entries, {Metadata metadata})
+ /// A test to run before all tests in the group.
+ ///
+ /// This is `null` if no `setUpAll` callbacks were declared.
+ final Test setUpAll;
+
+ /// A test to run after all tests in the group.
+ ///
+ /// This is `null` if no `tearDown` callbacks were declared.
+ final Test tearDownAll;
+
+ Group(this.name, Iterable<GroupEntry> entries, {Metadata metadata,
+ Test this.setUpAll, Test this.tearDownAll})
: entries = new List<GroupEntry>.unmodifiable(entries),
metadata = metadata == null ? new Metadata() : metadata;
@@ -34,13 +45,15 @@ class Group implements GroupEntry {
var newMetadata = metadata.forPlatform(platform, os: os);
var filtered = _map((entry) => entry.forPlatform(platform, os: os));
if (filtered.isEmpty) return null;
- return new Group(name, filtered, metadata: newMetadata);
+ return new Group(name, filtered,
+ metadata: newMetadata, setUpAll: setUpAll, tearDownAll: tearDownAll);
}
Group filter(bool callback(Test test)) {
var filtered = _map((entry) => entry.filter(callback));
if (filtered.isEmpty) return null;
- return new Group(name, filtered, metadata: metadata);
+ return new Group(name, filtered,
+ metadata: metadata, setUpAll: setUpAll, tearDownAll: tearDownAll);
}
/// Returns the entries of this group mapped using [callback].
« no previous file with comments | « lib/src/backend/declarer.dart ('k') | lib/src/runner/browser/browser_manager.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698