Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix tests
  • Loading branch information
vashworth committed May 27, 2025
commit ad7f570996abe871571d2be692eb51e0d9445d64
Original file line number Diff line number Diff line change
Expand Up @@ -53,46 +53,49 @@ void main() {
group(
'Xcode build iOS app',
() {
test('succeeds when Flutter CLI last used configuration matches Xcode configuration', () async {
final List<String> flutterCommand = <String>[
flutterBin,
...getLocalEngineArguments(),
'build',
'ios',
'--config-only',
'--debug',
];
final ProcessResult flutterResult = await processManager.run(
flutterCommand,
workingDirectory: projectDir.path,
);

expect(flutterResult, const ProcessResultMatcher());

final List<String> xcodeCommand = <String>[
'xcodebuild',
'-workspace',
'ios/Runner.xcworkspace',
'-scheme',
'Runner',
'-destination',
'generic/platform=iOS Simulator',
'CODE_SIGNING_ALLOWED=NO',
'CODE_SIGNING_REQUIRED=NO',
'CODE_SIGN_IDENTITY=-',
'EXPANDED_CODE_SIGN_IDENTITY=-',
'COMPILER_INDEX_STORE_ENABLE=NO',
'VERBOSE_SCRIPT_LOGGING=true',
'-configuration',
'Debug',
];
final ProcessResult xcodeResult = await processManager.run(
xcodeCommand,
workingDirectory: projectDir.path,
);

expect(xcodeResult, const ProcessResultMatcher(stdoutPattern: '** BUILD SUCCEEDED **'));
});
test(
'succeeds when Flutter CLI last used configuration matches Xcode configuration',
() async {
final List<String> flutterCommand = <String>[
flutterBin,
...getLocalEngineArguments(),
'build',
'ios',
'--config-only',
'--debug',
];
final ProcessResult flutterResult = await processManager.run(
flutterCommand,
workingDirectory: projectDir.path,
);

expect(flutterResult, const ProcessResultMatcher());

final List<String> xcodeCommand = <String>[
'xcodebuild',
'-workspace',
'ios/Runner.xcworkspace',
'-scheme',
'Runner',
'-destination',
'generic/platform=iOS Simulator',
'CODE_SIGNING_ALLOWED=NO',
'CODE_SIGNING_REQUIRED=NO',
'CODE_SIGN_IDENTITY=-',
'EXPANDED_CODE_SIGN_IDENTITY=-',
'COMPILER_INDEX_STORE_ENABLE=NO',
'VERBOSE_SCRIPT_LOGGING=true',
'-configuration',
'Debug',
];
final ProcessResult xcodeResult = await processManager.run(
xcodeCommand,
workingDirectory: projectDir.path,
);

expect(xcodeResult, const ProcessResultMatcher(stdoutPattern: '** BUILD SUCCEEDED **'));
},
);

test(
'fails if Flutter CLI last used configuration does not match Xcode configuration when archiving',
Expand Down Expand Up @@ -201,73 +204,76 @@ void main() {
group(
'Xcode build iOS module',
() {
test('succeeds when Flutter CLI last used configuration matches Xcode configuration', () async {
final Directory moduleDirectory = projectDir.childDirectory('hello');
await processManager.run(<String>[
flutterBin,
'create',
moduleDirectory.path,
'--template=module',
'--project-name=hello',
], workingDirectory: projectDir.path);

final List<String> flutterCommand = <String>[
flutterBin,
...getLocalEngineArguments(),
'build',
'ios',
'--config-only',
'--debug',
];
final ProcessResult flutterResult = await processManager.run(
flutterCommand,
workingDirectory: moduleDirectory.path,
);

expect(flutterResult, const ProcessResultMatcher());

final Directory hostAppDirectory = projectDir.childDirectory('hello_host_app');
hostAppDirectory.createSync();

copyDirectory(
fileSystem.directory(
fileSystem.path.join(getFlutterRoot(), 'dev', 'integration_tests', 'ios_host_app'),
),
hostAppDirectory,
);

final ProcessResult podResult = await processManager.run(
const <String>['pod', 'install'],
workingDirectory: hostAppDirectory.path,
environment: const <String, String>{'LANG': 'en_US.UTF-8'},
);

expect(podResult, const ProcessResultMatcher());

final List<String> xcodeCommand = <String>[
'xcodebuild',
'-workspace',
'Host.xcworkspace',
'-scheme',
'Host',
'-destination',
'generic/platform=iOS',
'CODE_SIGNING_ALLOWED=NO',
'CODE_SIGNING_REQUIRED=NO',
'CODE_SIGN_IDENTITY=-',
'EXPANDED_CODE_SIGN_IDENTITY=-',
'COMPILER_INDEX_STORE_ENABLE=NO',
'VERBOSE_SCRIPT_LOGGING=true',
'-configuration',
'Debug',
];
final ProcessResult xcodeResult = await processManager.run(
xcodeCommand,
workingDirectory: hostAppDirectory.path,
);

expect(xcodeResult, const ProcessResultMatcher(stdoutPattern: '** BUILD SUCCEEDED **'));
});
test(
'succeeds when Flutter CLI last used configuration matches Xcode configuration',
() async {
final Directory moduleDirectory = projectDir.childDirectory('hello');
await processManager.run(<String>[
flutterBin,
'create',
moduleDirectory.path,
'--template=module',
'--project-name=hello',
], workingDirectory: projectDir.path);

final List<String> flutterCommand = <String>[
flutterBin,
...getLocalEngineArguments(),
'build',
'ios',
'--config-only',
'--debug',
];
final ProcessResult flutterResult = await processManager.run(
flutterCommand,
workingDirectory: moduleDirectory.path,
);

expect(flutterResult, const ProcessResultMatcher());

final Directory hostAppDirectory = projectDir.childDirectory('hello_host_app');
hostAppDirectory.createSync();

copyDirectory(
fileSystem.directory(
fileSystem.path.join(getFlutterRoot(), 'dev', 'integration_tests', 'ios_host_app'),
),
hostAppDirectory,
);

final ProcessResult podResult = await processManager.run(
const <String>['pod', 'install'],
workingDirectory: hostAppDirectory.path,
environment: const <String, String>{'LANG': 'en_US.UTF-8'},
);

expect(podResult, const ProcessResultMatcher());

final List<String> xcodeCommand = <String>[
'xcodebuild',
'-workspace',
'Host.xcworkspace',
'-scheme',
'Host',
'-destination',
'generic/platform=iOS',
'CODE_SIGNING_ALLOWED=NO',
'CODE_SIGNING_REQUIRED=NO',
'CODE_SIGN_IDENTITY=-',
'EXPANDED_CODE_SIGN_IDENTITY=-',
'COMPILER_INDEX_STORE_ENABLE=NO',
'VERBOSE_SCRIPT_LOGGING=true',
'-configuration',
'Debug',
];
final ProcessResult xcodeResult = await processManager.run(
xcodeCommand,
workingDirectory: hostAppDirectory.path,
);

expect(xcodeResult, const ProcessResultMatcher(stdoutPattern: '** BUILD SUCCEEDED **'));
},
);

test(
'fails if Flutter CLI last used configuration does not match Xcode configuration when archiving',
Expand Down Expand Up @@ -429,46 +435,49 @@ void main() {
group(
'Xcode build macOS app',
() {
test('succeeds when Flutter CLI last used configuration matches Xcode configuration', () async {
final List<String> flutterCommand = <String>[
flutterBin,
...getLocalEngineArguments(),
'build',
'macos',
'--config-only',
'--debug',
];
final ProcessResult flutterResult = await processManager.run(
flutterCommand,
workingDirectory: projectDir.path,
);

expect(flutterResult, const ProcessResultMatcher());

final List<String> xcodeCommand = <String>[
'xcodebuild',
'-workspace',
'macos/Runner.xcworkspace',
'-scheme',
'Runner',
'-destination',
'platform=macOS',
'CODE_SIGNING_ALLOWED=NO',
'CODE_SIGNING_REQUIRED=NO',
'CODE_SIGN_IDENTITY=-',
'EXPANDED_CODE_SIGN_IDENTITY=-',
'COMPILER_INDEX_STORE_ENABLE=NO',
'VERBOSE_SCRIPT_LOGGING=true',
'-configuration',
'Debug',
];
final ProcessResult xcodeResult = await processManager.run(
xcodeCommand,
workingDirectory: projectDir.path,
);

expect(xcodeResult, const ProcessResultMatcher(stdoutPattern: '** BUILD SUCCEEDED **'));
});
test(
'succeeds when Flutter CLI last used configuration matches Xcode configuration',
() async {
final List<String> flutterCommand = <String>[
flutterBin,
...getLocalEngineArguments(),
'build',
'macos',
'--config-only',
'--debug',
];
final ProcessResult flutterResult = await processManager.run(
flutterCommand,
workingDirectory: projectDir.path,
);

expect(flutterResult, const ProcessResultMatcher());

final List<String> xcodeCommand = <String>[
'xcodebuild',
'-workspace',
'macos/Runner.xcworkspace',
'-scheme',
'Runner',
'-destination',
'platform=macOS',
'CODE_SIGNING_ALLOWED=NO',
'CODE_SIGNING_REQUIRED=NO',
'CODE_SIGN_IDENTITY=-',
'EXPANDED_CODE_SIGN_IDENTITY=-',
'COMPILER_INDEX_STORE_ENABLE=NO',
'VERBOSE_SCRIPT_LOGGING=true',
'-configuration',
'Debug',
];
final ProcessResult xcodeResult = await processManager.run(
xcodeCommand,
workingDirectory: projectDir.path,
);

expect(xcodeResult, const ProcessResultMatcher(stdoutPattern: '** BUILD SUCCEEDED **'));
},
);

test(
'fails if Flutter CLI last used configuration does not match Xcode configuration when archiving',
Expand Down