@@ -170,6 +170,61 @@ void main() {
170
170
);
171
171
});
172
172
173
+ testWithoutContext ('works if local engine is simulator' , () async {
174
+ final FileSystem fileSystem = MemoryFileSystem .test ();
175
+ final Directory localEngine = fileSystem
176
+ .directory ('$kArbitraryEngineRoot /src/out/ios_debug_sim/' )
177
+ ..createSync (recursive: true );
178
+ fileSystem
179
+ .directory ('$kArbitraryEngineRoot /src/out/host_debug/' )
180
+ .createSync (recursive: true );
181
+
182
+ final BufferLogger logger = BufferLogger .test ();
183
+ final LocalEngineLocator localEngineLocator = LocalEngineLocator (
184
+ fileSystem: fileSystem,
185
+ flutterRoot: 'flutter/flutter' ,
186
+ logger: logger,
187
+ userMessages: UserMessages (),
188
+ platform: FakePlatform (environment: < String , String > {}),
189
+ );
190
+
191
+ expect (
192
+ await localEngineLocator.findEnginePath (localEngine: localEngine.path),
193
+ matchesEngineBuildPaths (
194
+ hostEngine: '/arbitrary/engine/src/out/host_debug' ,
195
+ targetEngine: '/arbitrary/engine/src/out/ios_debug_sim' ,
196
+ ),
197
+ );
198
+ });
199
+
200
+ testWithoutContext ('works if local engine is simulator unoptimized' ,
201
+ () async {
202
+ final FileSystem fileSystem = MemoryFileSystem .test ();
203
+ final Directory localEngine = fileSystem
204
+ .directory ('$kArbitraryEngineRoot /src/out/ios_debug_sim_unopt/' )
205
+ ..createSync (recursive: true );
206
+ fileSystem
207
+ .directory ('$kArbitraryEngineRoot /src/out/host_debug_unopt/' )
208
+ .createSync (recursive: true );
209
+
210
+ final BufferLogger logger = BufferLogger .test ();
211
+ final LocalEngineLocator localEngineLocator = LocalEngineLocator (
212
+ fileSystem: fileSystem,
213
+ flutterRoot: 'flutter/flutter' ,
214
+ logger: logger,
215
+ userMessages: UserMessages (),
216
+ platform: FakePlatform (environment: < String , String > {}),
217
+ );
218
+
219
+ expect (
220
+ await localEngineLocator.findEnginePath (localEngine: localEngine.path),
221
+ matchesEngineBuildPaths (
222
+ hostEngine: '/arbitrary/engine/src/out/host_debug_unopt' ,
223
+ targetEngine: '/arbitrary/engine/src/out/ios_debug_sim_unopt' ,
224
+ ),
225
+ );
226
+ });
227
+
173
228
testWithoutContext ('fails if host_debug does not exist' , () async {
174
229
final FileSystem fileSystem = MemoryFileSystem .test ();
175
230
final Directory localEngine = fileSystem
0 commit comments