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

Unified Diff: lib/src/runner/runner_suite.dart

Issue 1379203002: Refactor groups to pipe them through to the runner. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes 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/runner/loader.dart ('k') | lib/src/runner/vm/isolate_listener.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/runner_suite.dart
diff --git a/lib/src/runner/runner_suite.dart b/lib/src/runner/runner_suite.dart
index 2407f69fd267702c984fed1a95b159aa24fb7acc..69cc373177893f1fc43aea912286936c2b4b8bd0 100644
--- a/lib/src/runner/runner_suite.dart
+++ b/lib/src/runner/runner_suite.dart
@@ -11,6 +11,7 @@ import 'package:async/async.dart';
import '../backend/metadata.dart';
import '../backend/operating_system.dart';
import '../backend/suite.dart';
+import '../backend/suite_entry.dart';
import '../backend/test.dart';
import '../backend/test_platform.dart';
import '../utils.dart';
@@ -31,19 +32,20 @@ class RunnerSuite extends Suite {
/// The function to call when the suite is closed.
final AsyncFunction _onClose;
- RunnerSuite(this.environment, Iterable<Test> tests, {String path,
+ RunnerSuite(this.environment, Iterable<SuiteEntry> entries, {String path,
TestPlatform platform, OperatingSystem os, Metadata metadata,
AsyncFunction onClose})
- : super(tests,
+ : super(entries,
path: path, platform: platform, os: os, metadata: metadata),
_onClose = onClose;
- RunnerSuite change({String path, Metadata metadata, Iterable<Test> tests}) {
- if (path == null) path = this.path;
- if (metadata == null) metadata = this.metadata;
- if (tests == null) tests = this.tests;
- return new RunnerSuite(environment, tests, platform: platform, os: os,
- path: path, metadata: metadata, onClose: close);
+ RunnerSuite filter(bool callback(Test test)) {
+ var filtered = entries
+ .map((entry) => entry.filter(callback))
+ .where((entry) => entry != null)
+ .toList();
+ return new RunnerSuite(environment, filtered,
+ platform: platform, os: os, path: path, metadata: metadata);
}
/// Closes the suite and releases any resources associated with it.
« no previous file with comments | « lib/src/runner/loader.dart ('k') | lib/src/runner/vm/isolate_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698