Rename shellPath
to flutterTesterBinPath
. (#161189)
Closes https://github.com/flutter/flutter/issues/160462. Maybe there are people who consider `flutter_tester` as the flutter "shell", but this is more explicit.
This commit is contained in:
parent
434ca754e3
commit
bb805fad1e
@ -51,7 +51,7 @@ Future<void> run(List<String> args) async {
|
|||||||
final ArgParser parser =
|
final ArgParser parser =
|
||||||
ArgParser()
|
ArgParser()
|
||||||
..addOption(_kOptionPackages, help: 'The .packages file')
|
..addOption(_kOptionPackages, help: 'The .packages file')
|
||||||
..addOption(_kOptionShell, help: 'The Flutter shell binary')
|
..addOption(_kOptionShell, help: 'The flutter_tester binary')
|
||||||
..addOption(_kOptionTestDirectory, help: 'Directory containing the tests')
|
..addOption(_kOptionTestDirectory, help: 'Directory containing the tests')
|
||||||
..addOption(_kOptionSdkRoot, help: 'Path to the SDK platform files')
|
..addOption(_kOptionSdkRoot, help: 'Path to the SDK platform files')
|
||||||
..addOption(_kOptionIcudtl, help: 'Path to the ICU data file')
|
..addOption(_kOptionIcudtl, help: 'Path to the ICU data file')
|
||||||
@ -83,9 +83,10 @@ Future<void> run(List<String> args) async {
|
|||||||
try {
|
try {
|
||||||
Cache.flutterRoot = tempDir.path;
|
Cache.flutterRoot = tempDir.path;
|
||||||
|
|
||||||
final String shellPath = globals.fs.file(argResults[_kOptionShell]).resolveSymbolicLinksSync();
|
final String flutterTesterBinPath =
|
||||||
if (!globals.fs.isFileSync(shellPath)) {
|
globals.fs.file(argResults[_kOptionShell]).resolveSymbolicLinksSync();
|
||||||
throwToolExit('Cannot find Flutter shell at $shellPath');
|
if (!globals.fs.isFileSync(flutterTesterBinPath)) {
|
||||||
|
throwToolExit('Cannot find Flutter shell at $flutterTesterBinPath');
|
||||||
}
|
}
|
||||||
|
|
||||||
final Directory sdkRootSrc = globals.fs.directory(argResults[_kOptionSdkRoot]);
|
final Directory sdkRootSrc = globals.fs.directory(argResults[_kOptionSdkRoot]);
|
||||||
@ -106,7 +107,7 @@ Future<void> run(List<String> args) async {
|
|||||||
final Artifacts artifacts = globals.artifacts!;
|
final Artifacts artifacts = globals.artifacts!;
|
||||||
final Link testerDestLink = globals.fs.link(artifacts.getArtifactPath(Artifact.flutterTester));
|
final Link testerDestLink = globals.fs.link(artifacts.getArtifactPath(Artifact.flutterTester));
|
||||||
testerDestLink.parent.createSync(recursive: true);
|
testerDestLink.parent.createSync(recursive: true);
|
||||||
testerDestLink.createSync(globals.fs.path.absolute(shellPath));
|
testerDestLink.createSync(globals.fs.path.absolute(flutterTesterBinPath));
|
||||||
|
|
||||||
final Directory sdkRootDest = globals.fs.directory(
|
final Directory sdkRootDest = globals.fs.directory(
|
||||||
artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath),
|
artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath),
|
||||||
|
@ -56,7 +56,7 @@ typedef PlatformPluginRegistration = void Function(FlutterPlatform platform);
|
|||||||
/// main()`), you can set a VM Service port explicitly.
|
/// main()`), you can set a VM Service port explicitly.
|
||||||
FlutterPlatform installHook({
|
FlutterPlatform installHook({
|
||||||
TestWrapper testWrapper = const TestWrapper(),
|
TestWrapper testWrapper = const TestWrapper(),
|
||||||
required String shellPath,
|
required String flutterTesterBinPath,
|
||||||
required DebuggingOptions debuggingOptions,
|
required DebuggingOptions debuggingOptions,
|
||||||
required BuildInfo buildInfo,
|
required BuildInfo buildInfo,
|
||||||
required FileSystem fileSystem,
|
required FileSystem fileSystem,
|
||||||
@ -91,7 +91,7 @@ FlutterPlatform installHook({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
final FlutterPlatform platform = FlutterPlatform(
|
final FlutterPlatform platform = FlutterPlatform(
|
||||||
shellPath: shellPath,
|
flutterTesterBinPath: flutterTesterBinPath,
|
||||||
debuggingOptions: debuggingOptions,
|
debuggingOptions: debuggingOptions,
|
||||||
watcher: watcher,
|
watcher: watcher,
|
||||||
machine: machine,
|
machine: machine,
|
||||||
@ -298,7 +298,7 @@ typedef Finalizer = Future<void> Function();
|
|||||||
/// The flutter test platform used to integrate with package:test.
|
/// The flutter test platform used to integrate with package:test.
|
||||||
class FlutterPlatform extends PlatformPlugin {
|
class FlutterPlatform extends PlatformPlugin {
|
||||||
FlutterPlatform({
|
FlutterPlatform({
|
||||||
required this.shellPath,
|
required this.flutterTesterBinPath,
|
||||||
required this.debuggingOptions,
|
required this.debuggingOptions,
|
||||||
required this.buildInfo,
|
required this.buildInfo,
|
||||||
required this.logger,
|
required this.logger,
|
||||||
@ -322,7 +322,7 @@ class FlutterPlatform extends PlatformPlugin {
|
|||||||
this.shutdownHooks,
|
this.shutdownHooks,
|
||||||
}) {
|
}) {
|
||||||
_testGoldenComparator = TestGoldenComparator(
|
_testGoldenComparator = TestGoldenComparator(
|
||||||
flutterTesterBinPath: shellPath,
|
flutterTesterBinPath: flutterTesterBinPath,
|
||||||
compilerFactory:
|
compilerFactory:
|
||||||
() =>
|
() =>
|
||||||
compiler ??
|
compiler ??
|
||||||
@ -333,7 +333,7 @@ class FlutterPlatform extends PlatformPlugin {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final String shellPath;
|
final String flutterTesterBinPath;
|
||||||
final DebuggingOptions debuggingOptions;
|
final DebuggingOptions debuggingOptions;
|
||||||
final TestWatcher? watcher;
|
final TestWatcher? watcher;
|
||||||
final bool? enableVmService;
|
final bool? enableVmService;
|
||||||
@ -496,7 +496,7 @@ class FlutterPlatform extends PlatformPlugin {
|
|||||||
fileSystem: globals.fs,
|
fileSystem: globals.fs,
|
||||||
processManager: globals.processManager,
|
processManager: globals.processManager,
|
||||||
logger: globals.logger,
|
logger: globals.logger,
|
||||||
shellPath: shellPath,
|
flutterTesterBinPath: flutterTesterBinPath,
|
||||||
enableVmService: enableVmService!,
|
enableVmService: enableVmService!,
|
||||||
machine: machine,
|
machine: machine,
|
||||||
debuggingOptions: debuggingOptions,
|
debuggingOptions: debuggingOptions,
|
||||||
|
@ -33,7 +33,7 @@ class FlutterTesterTestDevice extends TestDevice {
|
|||||||
required this.fileSystem,
|
required this.fileSystem,
|
||||||
required this.processManager,
|
required this.processManager,
|
||||||
required this.logger,
|
required this.logger,
|
||||||
required this.shellPath,
|
required this.flutterTesterBinPath,
|
||||||
required this.debuggingOptions,
|
required this.debuggingOptions,
|
||||||
required this.enableVmService,
|
required this.enableVmService,
|
||||||
required this.machine,
|
required this.machine,
|
||||||
@ -54,7 +54,7 @@ class FlutterTesterTestDevice extends TestDevice {
|
|||||||
final FileSystem fileSystem;
|
final FileSystem fileSystem;
|
||||||
final ProcessManager processManager;
|
final ProcessManager processManager;
|
||||||
final Logger logger;
|
final Logger logger;
|
||||||
final String shellPath;
|
final String flutterTesterBinPath;
|
||||||
final DebuggingOptions debuggingOptions;
|
final DebuggingOptions debuggingOptions;
|
||||||
final bool enableVmService;
|
final bool enableVmService;
|
||||||
final bool? machine;
|
final bool? machine;
|
||||||
@ -89,7 +89,7 @@ class FlutterTesterTestDevice extends TestDevice {
|
|||||||
_server = await bind(host, /*port*/ 0);
|
_server = await bind(host, /*port*/ 0);
|
||||||
logger.printTrace('test $id: test harness socket server is running at port:${_server!.port}');
|
logger.printTrace('test $id: test harness socket server is running at port:${_server!.port}');
|
||||||
final List<String> command = <String>[
|
final List<String> command = <String>[
|
||||||
shellPath,
|
flutterTesterBinPath,
|
||||||
if (enableVmService) ...<String>[
|
if (enableVmService) ...<String>[
|
||||||
// Some systems drive the _FlutterPlatform class in an unusual way, where
|
// Some systems drive the _FlutterPlatform class in an unusual way, where
|
||||||
// only one test file is processed at a time, and the operating
|
// only one test file is processed at a time, and the operating
|
||||||
|
@ -218,7 +218,7 @@ class _FlutterTestRunnerImpl implements FlutterTestRunner {
|
|||||||
|
|
||||||
final loader.FlutterPlatform platform = loader.installHook(
|
final loader.FlutterPlatform platform = loader.installHook(
|
||||||
testWrapper: testWrapper,
|
testWrapper: testWrapper,
|
||||||
shellPath: flutterTesterBinPath,
|
flutterTesterBinPath: flutterTesterBinPath,
|
||||||
debuggingOptions: debuggingOptions,
|
debuggingOptions: debuggingOptions,
|
||||||
watcher: watcher,
|
watcher: watcher,
|
||||||
enableVmService: enableVmService,
|
enableVmService: enableVmService,
|
||||||
|
@ -49,7 +49,7 @@ void main() {
|
|||||||
'explicitVmServicePort is specified and more than one test file',
|
'explicitVmServicePort is specified and more than one test file',
|
||||||
() async {
|
() async {
|
||||||
final FlutterPlatform flutterPlatform = FlutterPlatform(
|
final FlutterPlatform flutterPlatform = FlutterPlatform(
|
||||||
shellPath: '/',
|
flutterTesterBinPath: '/',
|
||||||
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug, hostVmServicePort: 1234),
|
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug, hostVmServicePort: 1234),
|
||||||
enableVmService: false,
|
enableVmService: false,
|
||||||
buildInfo: BuildInfo.debug,
|
buildInfo: BuildInfo.debug,
|
||||||
@ -76,7 +76,7 @@ void main() {
|
|||||||
() {
|
() {
|
||||||
final FlutterPlatform flutterPlatform = FlutterPlatform(
|
final FlutterPlatform flutterPlatform = FlutterPlatform(
|
||||||
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug),
|
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug),
|
||||||
shellPath: '/',
|
flutterTesterBinPath: '/',
|
||||||
precompiledDillPath: 'example.dill',
|
precompiledDillPath: 'example.dill',
|
||||||
enableVmService: false,
|
enableVmService: false,
|
||||||
buildInfo: BuildInfo.debug,
|
buildInfo: BuildInfo.debug,
|
||||||
@ -103,7 +103,7 @@ void main() {
|
|||||||
final _UnstartableDevice testDevice = _UnstartableDevice();
|
final _UnstartableDevice testDevice = _UnstartableDevice();
|
||||||
final FlutterPlatform flutterPlatform = FlutterPlatform(
|
final FlutterPlatform flutterPlatform = FlutterPlatform(
|
||||||
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug),
|
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug),
|
||||||
shellPath: '/',
|
flutterTesterBinPath: '/',
|
||||||
enableVmService: false,
|
enableVmService: false,
|
||||||
integrationTestDevice: testDevice,
|
integrationTestDevice: testDevice,
|
||||||
flutterProject: _FakeFlutterProject(),
|
flutterProject: _FakeFlutterProject(),
|
||||||
@ -146,7 +146,7 @@ void main() {
|
|||||||
final ShutdownHooks shutdownHooks = ShutdownHooks();
|
final ShutdownHooks shutdownHooks = ShutdownHooks();
|
||||||
final FlutterPlatform flutterPlatform = FlutterPlatform(
|
final FlutterPlatform flutterPlatform = FlutterPlatform(
|
||||||
debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug),
|
debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug),
|
||||||
shellPath: '/',
|
flutterTesterBinPath: '/',
|
||||||
enableVmService: false,
|
enableVmService: false,
|
||||||
integrationTestDevice: testDevice,
|
integrationTestDevice: testDevice,
|
||||||
flutterProject: _FakeFlutterProject(),
|
flutterProject: _FakeFlutterProject(),
|
||||||
@ -178,7 +178,7 @@ void main() {
|
|||||||
testUsingContext('installHook creates a FlutterPlatform', () {
|
testUsingContext('installHook creates a FlutterPlatform', () {
|
||||||
expect(
|
expect(
|
||||||
() => installHook(
|
() => installHook(
|
||||||
shellPath: 'abc',
|
flutterTesterBinPath: 'abc',
|
||||||
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug, startPaused: true),
|
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug, startPaused: true),
|
||||||
buildInfo: BuildInfo.debug,
|
buildInfo: BuildInfo.debug,
|
||||||
fileSystem: fileSystem,
|
fileSystem: fileSystem,
|
||||||
@ -190,7 +190,7 @@ void main() {
|
|||||||
|
|
||||||
expect(
|
expect(
|
||||||
() => installHook(
|
() => installHook(
|
||||||
shellPath: 'abc',
|
flutterTesterBinPath: 'abc',
|
||||||
debuggingOptions: DebuggingOptions.enabled(
|
debuggingOptions: DebuggingOptions.enabled(
|
||||||
BuildInfo.debug,
|
BuildInfo.debug,
|
||||||
startPaused: true,
|
startPaused: true,
|
||||||
@ -207,7 +207,7 @@ void main() {
|
|||||||
FlutterPlatform? capturedPlatform;
|
FlutterPlatform? capturedPlatform;
|
||||||
final Map<String, String> expectedPrecompiledDillFiles = <String, String>{'Key': 'Value'};
|
final Map<String, String> expectedPrecompiledDillFiles = <String, String>{'Key': 'Value'};
|
||||||
final FlutterPlatform flutterPlatform = installHook(
|
final FlutterPlatform flutterPlatform = installHook(
|
||||||
shellPath: 'abc',
|
flutterTesterBinPath: 'abc',
|
||||||
debuggingOptions: DebuggingOptions.enabled(
|
debuggingOptions: DebuggingOptions.enabled(
|
||||||
BuildInfo.debug,
|
BuildInfo.debug,
|
||||||
startPaused: true,
|
startPaused: true,
|
||||||
@ -232,7 +232,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
expect(identical(capturedPlatform, flutterPlatform), equals(true));
|
expect(identical(capturedPlatform, flutterPlatform), equals(true));
|
||||||
expect(flutterPlatform.shellPath, equals('abc'));
|
expect(flutterPlatform.flutterTesterBinPath, equals('abc'));
|
||||||
expect(flutterPlatform.debuggingOptions.buildInfo, equals(BuildInfo.debug));
|
expect(flutterPlatform.debuggingOptions.buildInfo, equals(BuildInfo.debug));
|
||||||
expect(flutterPlatform.debuggingOptions.startPaused, equals(true));
|
expect(flutterPlatform.debuggingOptions.startPaused, equals(true));
|
||||||
expect(flutterPlatform.debuggingOptions.disableServiceAuthCodes, equals(true));
|
expect(flutterPlatform.debuggingOptions.disableServiceAuthCodes, equals(true));
|
||||||
@ -346,7 +346,7 @@ void main() {
|
|||||||
const Device? notAnIntegrationTest = null;
|
const Device? notAnIntegrationTest = null;
|
||||||
final FlutterPlatform flutterPlatform = FlutterPlatform(
|
final FlutterPlatform flutterPlatform = FlutterPlatform(
|
||||||
debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug),
|
debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug),
|
||||||
shellPath: 'flutter_tester',
|
flutterTesterBinPath: 'flutter_tester',
|
||||||
enableVmService: false,
|
enableVmService: false,
|
||||||
// ignore: avoid_redundant_argument_values
|
// ignore: avoid_redundant_argument_values
|
||||||
integrationTestDevice: notAnIntegrationTest,
|
integrationTestDevice: notAnIntegrationTest,
|
||||||
@ -409,7 +409,7 @@ void main() {
|
|||||||
|
|
||||||
final FlutterPlatform flutterPlatform = FlutterPlatform(
|
final FlutterPlatform flutterPlatform = FlutterPlatform(
|
||||||
debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug),
|
debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug),
|
||||||
shellPath: 'flutter_tester',
|
flutterTesterBinPath: 'flutter_tester',
|
||||||
enableVmService: false,
|
enableVmService: false,
|
||||||
flutterProject: flutterProject,
|
flutterProject: flutterProject,
|
||||||
integrationTestDevice: _WorkingDevice(),
|
integrationTestDevice: _WorkingDevice(),
|
||||||
|
@ -333,7 +333,7 @@ class TestFlutterTesterDevice extends FlutterTesterTestDevice {
|
|||||||
super.flutterProject,
|
super.flutterProject,
|
||||||
}) : super(
|
}) : super(
|
||||||
id: 999,
|
id: 999,
|
||||||
shellPath: '/',
|
flutterTesterBinPath: '/',
|
||||||
logger: BufferLogger.test(),
|
logger: BufferLogger.test(),
|
||||||
debuggingOptions: DebuggingOptions.enabled(
|
debuggingOptions: DebuggingOptions.enabled(
|
||||||
const BuildInfo(
|
const BuildInfo(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user