| Index: lib/src/backend/suite.dart
|
| diff --git a/lib/src/backend/suite.dart b/lib/src/backend/suite.dart
|
| index 584ae9a10d61d2e983d7817137f52a3bb334e7e0..e622123fd1ba9132318a9544c04302326ce514ba 100644
|
| --- a/lib/src/backend/suite.dart
|
| +++ b/lib/src/backend/suite.dart
|
| @@ -7,7 +7,9 @@ library unittest.backend.suite;
|
| import 'dart:collection';
|
|
|
| import 'metadata.dart';
|
| +import 'operating_system.dart';
|
| import 'test.dart';
|
| +import 'test_platform.dart';
|
|
|
| /// A test suite.
|
| ///
|
| @@ -31,6 +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].
|
| + ///
|
| + /// If the suite itself is invalid for [platform] and [os], returns `null`.
|
| + Suite filter(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);
|
| + }));
|
| + }
|
| +
|
| /// Returns a new suite with the given fields updated.
|
| Suite change({String path, String platform, Metadata metadata,
|
| Iterable<Test> tests}) {
|
|
|