[flutter_tools] add support for --enable-impeller to test device. (#140899)
This allows unit tests to use the impeller backend, which can be useful for Scubas/golden tests.
This commit is contained in:
parent
0e11246b62
commit
0d378ed5ab
@ -74,6 +74,7 @@ class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts {
|
|||||||
usesWebRendererOption();
|
usesWebRendererOption();
|
||||||
usesDeviceUserOption();
|
usesDeviceUserOption();
|
||||||
usesFlavorOption();
|
usesFlavorOption();
|
||||||
|
addEnableImpellerFlag(verboseHelp: verboseHelp);
|
||||||
|
|
||||||
argParser
|
argParser
|
||||||
..addMultiOption('name',
|
..addMultiOption('name',
|
||||||
@ -436,6 +437,7 @@ class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts {
|
|||||||
enableDds: enableDds,
|
enableDds: enableDds,
|
||||||
nullAssertions: boolArg(FlutterOptions.kNullAssertions),
|
nullAssertions: boolArg(FlutterOptions.kNullAssertions),
|
||||||
usingCISystem: usingCISystem,
|
usingCISystem: usingCISystem,
|
||||||
|
enableImpeller: ImpellerStatus.fromBool(argResults!['enable-impeller'] as bool?),
|
||||||
);
|
);
|
||||||
|
|
||||||
Device? integrationTestDevice;
|
Device? integrationTestDevice;
|
||||||
|
@ -109,8 +109,13 @@ class FlutterTesterTestDevice extends TestDevice {
|
|||||||
if (icudtlPath != null) '--icu-data-file-path=$icudtlPath',
|
if (icudtlPath != null) '--icu-data-file-path=$icudtlPath',
|
||||||
'--enable-checked-mode',
|
'--enable-checked-mode',
|
||||||
'--verify-entry-points',
|
'--verify-entry-points',
|
||||||
'--enable-software-rendering',
|
if (debuggingOptions.enableImpeller == ImpellerStatus.enabled)
|
||||||
'--skia-deterministic-rendering',
|
'--enable-impeller'
|
||||||
|
else
|
||||||
|
...<String>[
|
||||||
|
'--enable-software-rendering',
|
||||||
|
'--skia-deterministic-rendering',
|
||||||
|
],
|
||||||
if (debuggingOptions.enableDartProfiling)
|
if (debuggingOptions.enableDartProfiling)
|
||||||
'--enable-dart-profiling',
|
'--enable-dart-profiling',
|
||||||
'--non-interactive',
|
'--non-interactive',
|
||||||
|
@ -996,6 +996,23 @@ dev_dependencies:
|
|||||||
FileSystem: () => fs,
|
FileSystem: () => fs,
|
||||||
ProcessManager: () => FakeProcessManager.any(),
|
ProcessManager: () => FakeProcessManager.any(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
testUsingContext('Enables Impeller', () async {
|
||||||
|
final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0);
|
||||||
|
|
||||||
|
final TestCommand testCommand = TestCommand(testRunner: testRunner);
|
||||||
|
final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand);
|
||||||
|
|
||||||
|
await commandRunner.run(const <String>[
|
||||||
|
'test',
|
||||||
|
'--no-pub',
|
||||||
|
'--enable-impeller',
|
||||||
|
]);
|
||||||
|
expect(testRunner.lastDebuggingOptionsValue.enableImpeller, ImpellerStatus.enabled);
|
||||||
|
}, overrides: <Type, Generator>{
|
||||||
|
FileSystem: () => fs,
|
||||||
|
ProcessManager: () => FakeProcessManager.any(),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user