Index: lib/src/runner/runner_suite.dart |
diff --git a/lib/src/runner/runner_suite.dart b/lib/src/runner/runner_suite.dart |
index 10064afe244a84c8fcda7b4e9f23c07c8307297a..2407f69fd267702c984fed1a95b159aa24fb7acc 100644 |
--- a/lib/src/runner/runner_suite.dart |
+++ b/lib/src/runner/runner_suite.dart |
@@ -14,6 +14,7 @@ import '../backend/suite.dart'; |
import '../backend/test.dart'; |
import '../backend/test_platform.dart'; |
import '../utils.dart'; |
+import 'environment.dart'; |
/// A suite produced and consumed by the test runner that has runner-specific |
/// logic and lifecycle management. |
@@ -22,33 +23,27 @@ import '../utils.dart'; |
/// eventually become its own package) is primarily for test code itself to use, |
/// for which the [RunnerSuite] APIs don't make sense. |
class RunnerSuite extends Suite { |
+ final Environment environment; |
+ |
/// The memoizer for running [close] exactly once. |
final _closeMemo = new AsyncMemoizer(); |
/// The function to call when the suite is closed. |
final AsyncFunction _onClose; |
- RunnerSuite(Iterable<Test> tests, {String path, TestPlatform platform, |
- OperatingSystem os, Metadata metadata, AsyncFunction onClose}) |
+ RunnerSuite(this.environment, Iterable<Test> tests, {String path, |
+ TestPlatform platform, OperatingSystem os, Metadata metadata, |
+ AsyncFunction onClose}) |
: super(tests, |
path: path, platform: platform, os: os, metadata: metadata), |
_onClose = onClose; |
- /// Creates a new [RunnerSuite] with the same properties as [suite]. |
- RunnerSuite.fromSuite(Suite suite) |
- : super(suite.tests, |
- path: suite.path, |
- platform: suite.platform, |
- os: suite.os, |
- metadata: suite.metadata), |
- _onClose = null; |
- |
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(tests, platform: platform, os: os, path: path, |
- metadata: metadata, onClose: this.close); |
+ return new RunnerSuite(environment, tests, platform: platform, os: os, |
+ path: path, metadata: metadata, onClose: close); |
} |
/// Closes the suite and releases any resources associated with it. |