pass --no-gen-bytecode to aot kernel compiler invocations (#43753)

This commit is contained in:
Jonah Williams
2019-10-29 16:05:54 -07:00
committed by GitHub
parent 7e60a65ff0
commit b1aff28593
2 changed files with 26 additions and 0 deletions

View File

@@ -324,6 +324,8 @@ class KernelCompiler {
if (aot) ...<String>[
'--aot',
'--tfa',
// TODO(jonahwilliams): remove when https://github.com/flutter/flutter/issues/43751 is resolved.
'--no-gen-bytecode',
],
if (packagesPath != null) ...<String>[
'--packages',

View File

@@ -66,6 +66,30 @@ void main() {
Platform: kNoColorTerminalPlatform,
});
testUsingContext('passes no-gen-bytecode to kernel compiler in aot/release mode', () async {
when(mockFrontendServer.stdout)
.thenAnswer((Invocation invocation) => Stream<List<int>>.fromFuture(
Future<List<int>>.value(utf8.encode(
'result abc\nline1\nline2\nabc\nabc /path/to/main.dart.dill 0'
))
));
final KernelCompiler kernelCompiler = await kernelCompilerFactory.create(null);
await kernelCompiler.compile(sdkRoot: '/path/to/sdkroot',
mainPath: '/path/to/main.dart',
buildMode: BuildMode.release,
trackWidgetCreation: false,
aot: true,
);
expect(mockFrontendServerStdIn.getAndClear(), isEmpty);
final VerificationResult argVerification = verify(mockProcessManager.start(captureAny));
expect(argVerification.captured.single, contains('--no-gen-bytecode'));
}, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager,
OutputPreferences: () => OutputPreferences(showColor: false),
Platform: kNoColorTerminalPlatform,
});
testUsingContext('batch compile single dart failed compilation', () async {
final BufferLogger bufferLogger = logger;
when(mockFrontendServer.stdout)