Skip to content

Commit 986fd14

Browse files
authored
Fold _FlutterTestRunnerImpl into FlutterTestRunner. (#161188)
Closes flutter/flutter#160461. This pattern is covered by `interface class { ... }` in modern Dart. See <https://dart.dev/language/class-modifiers#interface>.
1 parent f3d2204 commit 986fd14

File tree

1 file changed

+5
-71
lines changed

1 file changed

+5
-71
lines changed

packages/flutter_tools/lib/src/test/runner.dart

Lines changed: 5 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -26,78 +26,11 @@ import 'test_wrapper.dart';
2626
import 'watcher.dart';
2727
import 'web_test_compiler.dart';
2828

29-
/// A class that abstracts launching the test process from the test runner.
30-
abstract class FlutterTestRunner {
31-
const factory FlutterTestRunner() = _FlutterTestRunnerImpl;
29+
/// Launching the `flutter_tester` process from the test runner.
30+
interface class FlutterTestRunner {
31+
const FlutterTestRunner();
3232

3333
/// Runs tests using package:test and the Flutter engine.
34-
Future<int> runTests(
35-
TestWrapper testWrapper,
36-
List<Uri> testFiles, {
37-
required DebuggingOptions debuggingOptions,
38-
List<String> names = const <String>[],
39-
List<String> plainNames = const <String>[],
40-
String? tags,
41-
String? excludeTags,
42-
bool enableVmService = false,
43-
bool machine = false,
44-
String? precompiledDillPath,
45-
Map<String, String>? precompiledDillFiles,
46-
bool updateGoldens = false,
47-
TestWatcher? watcher,
48-
required int? concurrency,
49-
String? testAssetDirectory,
50-
FlutterProject? flutterProject,
51-
String? icudtlPath,
52-
Directory? coverageDirectory,
53-
bool web = false,
54-
String? randomSeed,
55-
String? reporter,
56-
String? fileReporter,
57-
String? timeout,
58-
bool failFast = false,
59-
bool runSkipped = false,
60-
int? shardIndex,
61-
int? totalShards,
62-
Device? integrationTestDevice,
63-
String? integrationTestUserIdentifier,
64-
TestTimeRecorder? testTimeRecorder,
65-
TestCompilerNativeAssetsBuilder? nativeAssetsBuilder,
66-
required BuildInfo buildInfo,
67-
});
68-
69-
/// Runs tests using the experimental strategy of spawning each test in a
70-
/// separate lightweight Engine.
71-
Future<int> runTestsBySpawningLightweightEngines(
72-
List<Uri> testFiles, {
73-
required DebuggingOptions debuggingOptions,
74-
List<String> names = const <String>[],
75-
List<String> plainNames = const <String>[],
76-
String? tags,
77-
String? excludeTags,
78-
bool machine = false,
79-
bool updateGoldens = false,
80-
required int? concurrency,
81-
String? testAssetDirectory,
82-
FlutterProject? flutterProject,
83-
String? icudtlPath,
84-
String? randomSeed,
85-
String? reporter,
86-
String? fileReporter,
87-
String? timeout,
88-
bool failFast = false,
89-
bool runSkipped = false,
90-
int? shardIndex,
91-
int? totalShards,
92-
TestTimeRecorder? testTimeRecorder,
93-
TestCompilerNativeAssetsBuilder? nativeAssetsBuilder,
94-
});
95-
}
96-
97-
class _FlutterTestRunnerImpl implements FlutterTestRunner {
98-
const _FlutterTestRunnerImpl();
99-
100-
@override
10134
Future<int> runTests(
10235
TestWrapper testWrapper,
10336
List<Uri> testFiles, {
@@ -637,7 +570,8 @@ class SpawnPlugin extends PlatformPlugin {
637570
testTimeRecorder?.stop(TestTimePhases.Compile, testTimeRecorderStopwatch!);
638571
}
639572

640-
@override
573+
/// Runs tests using the experimental strategy of spawning each test in a
574+
/// separate lightweight Engine.
641575
Future<int> runTestsBySpawningLightweightEngines(
642576
List<Uri> testFiles, {
643577
required DebuggingOptions debuggingOptions,

0 commit comments

Comments
 (0)