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

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

Issue 1027193004: Respect top-level @TestOn declarations. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Add another test. 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
Index: lib/src/backend/suite.dart
diff --git a/lib/src/backend/suite.dart b/lib/src/backend/suite.dart
index b2f3aff78581e0f5b10be1b81675273fa0c52555..584ae9a10d61d2e983d7817137f52a3bb334e7e0 100644
--- a/lib/src/backend/suite.dart
+++ b/lib/src/backend/suite.dart
@@ -6,6 +6,7 @@ library unittest.backend.suite;
import 'dart:collection';
+import 'metadata.dart';
import 'test.dart';
/// A test suite.
@@ -20,11 +21,23 @@ class Suite {
/// The path to the Dart test suite, or `null` if that path is unknown.
final String path;
+ /// The metadata associated with this test suite.
+ final Metadata metadata;
+
/// The tests in the test suite.
final List<Test> tests;
- Suite(Iterable<Test> tests, {String path, String platform})
- : path = path,
- platform = platform,
+ Suite(Iterable<Test> tests, {this.path, this.platform, Metadata metadata})
+ : metadata = metadata == null ? new Metadata() : metadata,
tests = new UnmodifiableListView<Test>(tests.toList());
+
+ /// Returns a new suite with the given fields updated.
+ Suite change({String path, String platform, Metadata metadata,
+ Iterable<Test> tests}) {
+ if (path == null) path = this.path;
+ if (platform == null) platform = this.platform;
+ if (metadata == null) metadata = this.metadata;
+ if (tests == null) tests = this.tests;
+ return new Suite(tests, path: path, platform: platform, metadata: metadata);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698