Extract KernelCompiler class (#16937)
Wraps the compile function in a class injected via the global context, which makes it easier to mock in unit tests -- specifically tests for AOT snapshotting, which already require pretty significant amounts of mock inputs.
This commit is contained in:
@@ -46,7 +46,7 @@ void main() {
|
||||
'result abc\nline1\nline2\nabc /path/to/main.dart.dill 0'
|
||||
))
|
||||
));
|
||||
final CompilerOutput output = await compile(sdkRoot: '/path/to/sdkroot',
|
||||
final CompilerOutput output = await kernelCompiler.compile(sdkRoot: '/path/to/sdkroot',
|
||||
mainPath: '/path/to/main.dart'
|
||||
);
|
||||
expect(mockFrontendServerStdIn.getAndClear(), isEmpty);
|
||||
@@ -66,7 +66,7 @@ void main() {
|
||||
))
|
||||
));
|
||||
|
||||
final CompilerOutput output = await compile(sdkRoot: '/path/to/sdkroot',
|
||||
final CompilerOutput output = await kernelCompiler.compile(sdkRoot: '/path/to/sdkroot',
|
||||
mainPath: '/path/to/main.dart'
|
||||
);
|
||||
expect(mockFrontendServerStdIn.getAndClear(), isEmpty);
|
||||
@@ -88,7 +88,7 @@ void main() {
|
||||
))
|
||||
));
|
||||
|
||||
final CompilerOutput output = await compile(sdkRoot: '/path/to/sdkroot',
|
||||
final CompilerOutput output = await kernelCompiler.compile(sdkRoot: '/path/to/sdkroot',
|
||||
mainPath: '/path/to/main.dart'
|
||||
);
|
||||
expect(mockFrontendServerStdIn.getAndClear(), isEmpty);
|
||||
|
||||
Reference in New Issue
Block a user