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

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

Issue 1097183003: Add an "onPlatform" parameter to test() and group(). (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 5 years, 8 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/metadata.dart ('k') | lib/src/backend/test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}));
}
« no previous file with comments | « lib/src/backend/metadata.dart ('k') | lib/src/backend/test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698