Index: lib/src/backend/live_test_controller.dart |
diff --git a/lib/src/backend/live_test_controller.dart b/lib/src/backend/live_test_controller.dart |
index f562c8e68f86416ebee73cecaad1757fca60f5d9..73cfa6d6d3a984e784bc83287d77c785c9ff5b8c 100644 |
--- a/lib/src/backend/live_test_controller.dart |
+++ b/lib/src/backend/live_test_controller.dart |
@@ -9,6 +9,7 @@ import 'dart:collection'; |
import 'package:stack_trace/stack_trace.dart'; |
+import 'group.dart'; |
import 'live_test.dart'; |
import 'state.dart'; |
import 'suite.dart'; |
@@ -20,6 +21,8 @@ class _LiveTest extends LiveTest { |
Suite get suite => _controller._suite; |
+ List<Group> get groups => _controller._groups; |
+ |
Test get test => _controller._test; |
State get state => _controller._state; |
@@ -59,6 +62,9 @@ class LiveTestController { |
/// The test suite that's running [this]. |
final Suite _suite; |
+ /// The groups containing [this]. |
+ final List<Group> _groups; |
+ |
/// The test that's being run. |
final Test _test; |
@@ -118,9 +124,17 @@ class LiveTestController { |
/// called. It should clean up any resources that have been allocated for the |
/// test and ensure that the test finishes quickly if it's still running. It |
/// will only be called if [onRun] has been called first. |
- LiveTestController(this._suite, this._test, void onRun(), void onClose()) |
- : _onRun = onRun, |
- _onClose = onClose { |
+ /// |
+ /// If [groups] is passed, it's used to populate the list of groups that |
+ /// contain this test. Otherwise, `suite.group` is used. |
+ LiveTestController(Suite suite, this._test, void onRun(), void onClose(), |
+ {Iterable<Group> groups}) |
+ : _suite = suite, |
+ _onRun = onRun, |
+ _onClose = onClose, |
+ _groups = groups == null |
+ ? [suite.group] |
+ : new List.unmodifiable(groups) { |
_liveTest = new _LiveTest(this); |
} |