mirror of
https://github.com/flutter/packages.git
synced 2025-08-06 00:42:13 +08:00
[ci/tools] Add iOS/macOS analysis to catch deprecated code (#5778)
This commit is contained in:
@ -123,6 +123,47 @@ void main() {
|
||||
]));
|
||||
});
|
||||
|
||||
test('passes min iOS deployment version when requested', () async {
|
||||
final RepositoryPackage plugin = createFakePlugin('plugin', packagesDir,
|
||||
platformSupport: <String, PlatformDetails>{
|
||||
platformIOS: const PlatformDetails(PlatformSupport.inline)
|
||||
});
|
||||
|
||||
final Directory pluginExampleDirectory = getExampleDir(plugin);
|
||||
|
||||
final List<String> output = await runCapturingPrint(runner,
|
||||
<String>['xcode-analyze', '--ios', '--ios-min-version=14.0']);
|
||||
|
||||
expect(
|
||||
output,
|
||||
containsAllInOrder(<Matcher>[
|
||||
contains('Running for plugin'),
|
||||
contains('plugin/example (iOS) passed analysis.')
|
||||
]));
|
||||
|
||||
expect(
|
||||
processRunner.recordedCalls,
|
||||
orderedEquals(<ProcessCall>[
|
||||
ProcessCall(
|
||||
'xcrun',
|
||||
const <String>[
|
||||
'xcodebuild',
|
||||
'analyze',
|
||||
'-workspace',
|
||||
'ios/Runner.xcworkspace',
|
||||
'-scheme',
|
||||
'Runner',
|
||||
'-configuration',
|
||||
'Debug',
|
||||
'-destination',
|
||||
'generic/platform=iOS Simulator',
|
||||
'IPHONEOS_DEPLOYMENT_TARGET=14.0',
|
||||
'GCC_TREAT_WARNINGS_AS_ERRORS=YES',
|
||||
],
|
||||
pluginExampleDirectory.path),
|
||||
]));
|
||||
});
|
||||
|
||||
test('fails if xcrun fails', () async {
|
||||
createFakePlugin('plugin', packagesDir,
|
||||
platformSupport: <String, PlatformDetails>{
|
||||
@ -218,6 +259,41 @@ void main() {
|
||||
]));
|
||||
});
|
||||
|
||||
test('passes min macOS deployment version when requested', () async {
|
||||
final RepositoryPackage plugin = createFakePlugin('plugin', packagesDir,
|
||||
platformSupport: <String, PlatformDetails>{
|
||||
platformMacOS: const PlatformDetails(PlatformSupport.inline),
|
||||
});
|
||||
|
||||
final Directory pluginExampleDirectory = getExampleDir(plugin);
|
||||
|
||||
final List<String> output = await runCapturingPrint(runner,
|
||||
<String>['xcode-analyze', '--macos', '--macos-min-version=12.0']);
|
||||
|
||||
expect(output,
|
||||
contains(contains('plugin/example (macOS) passed analysis.')));
|
||||
|
||||
expect(
|
||||
processRunner.recordedCalls,
|
||||
orderedEquals(<ProcessCall>[
|
||||
ProcessCall(
|
||||
'xcrun',
|
||||
const <String>[
|
||||
'xcodebuild',
|
||||
'analyze',
|
||||
'-workspace',
|
||||
'macos/Runner.xcworkspace',
|
||||
'-scheme',
|
||||
'Runner',
|
||||
'-configuration',
|
||||
'Debug',
|
||||
'MACOSX_DEPLOYMENT_TARGET=12.0',
|
||||
'GCC_TREAT_WARNINGS_AS_ERRORS=YES',
|
||||
],
|
||||
pluginExampleDirectory.path),
|
||||
]));
|
||||
});
|
||||
|
||||
test('fails if xcrun fails', () async {
|
||||
createFakePlugin('plugin', packagesDir,
|
||||
platformSupport: <String, PlatformDetails>{
|
||||
|
Reference in New Issue
Block a user