[go: nahoru, domu]

Skip to content

Commit

Permalink
Add test for engine artifact framework permissions (flutter#148786)
Browse files Browse the repository at this point in the history
Framework test to validate the iOS and macOS framework engine artifacts (Flutter.framework and FlutterMacOS.framework) have read and executable permissions.

~~Will fail until flutter/engine#52961 rolls.~~ <-- it rolled flutter#148819
  • Loading branch information
jmagman authored Jun 18, 2024
1 parent f2c48af commit 6c06abb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,9 @@ void main() {
);
expect(appCodesign, const ProcessResultMatcher());

// Check read/write permissions are being correctly set
final String rawStatString = flutterFrameworkDir.statSync().modeString();
final String statString = rawStatString.substring(rawStatString.length - 9);
expect(statString, 'rwxr-xr-x');
// Check read/write permissions are being correctly set.
final String statString = flutterFrameworkDir.statSync().mode.toRadixString(8);
expect(statString, '40755');
});
}, skip: !platform.isMacOS, // [intended] only makes sense for macos platform.
timeout: const Timeout(Duration(minutes: 10))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void main() {

final Directory tempDir = createResolvedTempDirectorySync('macos_content_validation.');

// Pre-cache iOS engine Flutter.xcframework artifacts.
// Pre-cache macOS engine FlutterMacOS.xcframework artifacts.
final ProcessResult result = processManager.runSync(
<String>[
flutterBin,
Expand All @@ -54,6 +54,17 @@ void main() {

expect(result, const ProcessResultMatcher());
expect(xcframeworkArtifact.existsSync(), isTrue);

final Directory frameworkArtifact = fileSystem.directory(
fileSystem.path.joinAll(<String>[
xcframeworkArtifact.path,
'macos-arm64_x86_64',
'FlutterMacOS.framework',
]),
);
// Check read/write permissions are set correctly in the framework engine artifact.
final String artifactStat = frameworkArtifact.statSync().mode.toRadixString(8);
expect(artifactStat, '40755');
});

for (final String buildMode in <String>['Debug', 'Release']) {
Expand Down Expand Up @@ -164,10 +175,9 @@ void main() {
),
);

// Check read/write permissions are being correctly set
final String rawStatString = outputFlutterFramework.statSync().modeString();
final String statString = rawStatString.substring(rawStatString.length - 9);
expect(statString, 'rwxr-xr-x');
// Check read/write permissions are being correctly set.
final String outputFrameworkStat = outputFlutterFramework.statSync().mode.toRadixString(8);
expect(outputFrameworkStat, '40755');

// Check complicated macOS framework symlink structure.
final Link current = outputFlutterFramework.childDirectory('Versions').childLink('Current');
Expand Down

0 comments on commit 6c06abb

Please sign in to comment.