Index: lib/src/backend/suite.dart |
diff --git a/lib/src/backend/suite.dart b/lib/src/backend/suite.dart |
index 78cb8742828891610ccd2dc410511b2e44212ef6..e7596a874ee8d8d3fa1725914d1ef51a770bc2e3 100644 |
--- a/lib/src/backend/suite.dart |
+++ b/lib/src/backend/suite.dart |
@@ -33,14 +33,17 @@ class Suite { |
: metadata = metadata == null ? new Metadata() : metadata, |
tests = new UnmodifiableListView<Test>(tests.toList()); |
- /// Returns a new suite that only contains tests that are valid for the given |
- /// [platform] and [os]. |
+ /// Returns a view of this suite for the given [platform] and [os]. |
/// |
- /// If the suite itself is invalid for [platform] and [os], returns `null`. |
- Suite filter(TestPlatform platform, {OperatingSystem os}) { |
+ /// This filters out tests that are invalid for [platform] and [os] and |
+ /// resolves platform-specific metadata. If the suite itself is invalid for |
+ /// [platform] and [os], returns `null`. |
+ Suite forPlatform(TestPlatform platform, {OperatingSystem os}) { |
if (!metadata.testOn.evaluate(platform, os: os)) return null; |
return change(tests: tests.where((test) { |
return test.metadata.testOn.evaluate(platform, os: os); |
+ }).map((test) { |
+ return test.change(metadata: test.metadata.forPlatform(platform, os: os)); |
})); |
} |