Fix compile expression in tests when precompiled dill files are used. (#84470)
This commit is contained in:
@@ -59,6 +59,23 @@ void main() {
|
||||
Logger: () => BufferLogger.test(),
|
||||
});
|
||||
|
||||
testUsingContext('TestCompiler does not try to cache the dill file when precompiled dill is passed', () async {
|
||||
residentCompiler.compilerOutput = const CompilerOutput('abc.dill', 0, <Uri>[]);
|
||||
final FakeTestCompiler testCompiler = FakeTestCompiler(
|
||||
debugBuild,
|
||||
FlutterProject.fromDirectoryTest(fileSystem.currentDirectory),
|
||||
residentCompiler,
|
||||
precompiledDillPath: 'precompiled.dill',
|
||||
);
|
||||
|
||||
expect(await testCompiler.compile(Uri.parse('test/foo.dart')), 'abc.dill');
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fileSystem,
|
||||
Platform: () => linuxPlatform,
|
||||
ProcessManager: () => FakeProcessManager.any(),
|
||||
Logger: () => BufferLogger.test(),
|
||||
});
|
||||
|
||||
testUsingContext('TestCompiler reports null when a compile fails', () async {
|
||||
residentCompiler.compilerOutput = const CompilerOutput('abc.dill', 1, <Uri>[]);
|
||||
final FakeTestCompiler testCompiler = FakeTestCompiler(
|
||||
@@ -103,8 +120,10 @@ class FakeTestCompiler extends TestCompiler {
|
||||
FakeTestCompiler(
|
||||
BuildInfo buildInfo,
|
||||
FlutterProject flutterProject,
|
||||
this.residentCompiler,
|
||||
) : super(buildInfo, flutterProject);
|
||||
this.residentCompiler, {
|
||||
String precompiledDillPath,
|
||||
}
|
||||
) : super(buildInfo, flutterProject, precompiledDillPath: precompiledDillPath);
|
||||
|
||||
final FakeResidentCompiler residentCompiler;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user