Use fs.identical to compare paths when finding the engine source path (#29386)

This will handle paths with symlinks that resolve to the same location.
This commit is contained in:
Jason Simmons
2019-03-15 09:32:10 -07:00
committed by GitHub
parent bd50007f16
commit e5696c2e7c
2 changed files with 6 additions and 1 deletions

View File

@@ -74,6 +74,11 @@ void main() {
fs.directory('$_kArbitraryEngineRoot/src/out/host_debug').createSync(recursive: true);
fs.file(_kDotPackages).writeAsStringSync('sky_engine:file://$_kArbitraryEngineRoot/src/out/ios_debug/gen/dart-pkg/sky_engine/lib/');
await runner.run(<String>['dummy', '--local-engine=ios_debug']);
// Verify that this also works if the sky_engine path is a symlink to the engine root.
fs.link('/symlink').createSync('$_kArbitraryEngineRoot');
fs.file(_kDotPackages).writeAsStringSync('sky_engine:file:///symlink/src/out/ios_debug/gen/dart-pkg/sky_engine/lib/');
await runner.run(<String>['dummy', '--local-engine=ios_debug']);
}, overrides: <Type, Generator>{
FileSystem: () => fs,
Platform: () => platform,