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

Unified Diff: lib/src/runner/load_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/engine.dart ('k') | lib/src/runner/loader.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/load_suite.dart
diff --git a/lib/src/runner/load_suite.dart b/lib/src/runner/load_suite.dart
index 0c1dabc5fa91afd3dae58b71e3d901b12b2272bb..04eb1cbf299ff5a49c34fb28fb0e5836e1199484 100644
--- a/lib/src/runner/load_suite.dart
+++ b/lib/src/runner/load_suite.dart
@@ -11,6 +11,7 @@ import 'package:stack_trace/stack_trace.dart';
import '../../test.dart';
import '../backend/invoker.dart';
import '../backend/metadata.dart';
+import '../backend/test.dart';
import '../backend/test_platform.dart';
import '../utils.dart';
import 'load_exception.dart';
@@ -39,6 +40,12 @@ class LoadSuite extends RunnerSuite {
/// example if an error occurred while loading it).
final Future<RunnerSuite> suite;
+ /// Returns the test that loads the suite.
+ ///
+ /// Load suites are guaranteed to only contain one test. This is a utility
+ /// method for accessing it directly.
+ Test get test => entries.single as Test;
+
/// Creates a load suite named [name] on [platform].
///
/// [body] may return either a [RunnerSuite] or a [Future] that completes to a
@@ -108,7 +115,7 @@ class LoadSuite extends RunnerSuite {
/// A constructor used by [changeSuite].
LoadSuite._changeSuite(LoadSuite old, Future<RunnerSuite> this.suite)
- : super(const VMEnvironment(), old.tests, platform: old.platform);
+ : super(const VMEnvironment(), old.entries, platform: old.platform);
/// Creates a new [LoadSuite] that's identical to this one, but that
/// transforms [suite] once it's loaded.
@@ -126,7 +133,7 @@ class LoadSuite extends RunnerSuite {
/// Rather than emitting errors through a [LiveTest], this just pipes them
/// through the return value.
Future<RunnerSuite> getSuite() async {
- var liveTest = await tests.single.load(this);
+ var liveTest = await test.load(this);
liveTest.onPrint.listen(print);
await liveTest.run();
« no previous file with comments | « lib/src/runner/engine.dart ('k') | lib/src/runner/loader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698