Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion script/tool/lib/src/native_test_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,9 @@ this command.
_printRunningExampleTestsMessage(example, platform);
final int exitCode = await _xcode.runXcodeBuild(
example.directory,
actions: <String>['test'],
// Clean before testing to remove cached swiftmodules from previous
// runs, which can cause conflicts.
actions: <String>['clean', 'test'],
workspace: '${platform.toLowerCase()}/Runner.xcworkspace',
scheme: 'Runner',
configuration: 'Debug',
Expand Down
4 changes: 3 additions & 1 deletion script/tool/lib/src/xcode_analyze_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ class XcodeAnalyzeCommand extends PackageLoopingCommand {
print('Running $platform tests and analyzer for $examplePath...');
final int exitCode = await _xcode.runXcodeBuild(
example.directory,
actions: <String>['analyze'],
// Clean before analyzing to remove cached swiftmodules from previous
// runs, which can cause conflicts.
actions: <String>['clean', 'analyze'],
workspace: '${platform.toLowerCase()}/Runner.xcworkspace',
scheme: 'Runner',
configuration: 'Debug',
Expand Down
7 changes: 4 additions & 3 deletions script/tool/test/native_test_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ void main() {
'xcrun',
<String>[
'xcodebuild',
'clean',
'test',
'-workspace',
'$platform/Runner.xcworkspace',
Expand Down Expand Up @@ -220,7 +221,7 @@ void main() {
getMockXcodebuildListProcess(<String>['RunnerTests', 'RunnerUITests']),
// Exit code 66 from testing indicates no tests.
FakeProcessInfo(
MockProcess(exitCode: 66), <String>['xcodebuild', 'test']),
MockProcess(exitCode: 66), <String>['xcodebuild', 'clean', 'test']),
];
final List<String> output = await runCapturingPrint(
runner, <String>['native-test', '--macos', '--no-unit']);
Expand Down Expand Up @@ -1469,11 +1470,11 @@ public class FlutterActivityTest {
getMockXcodebuildListProcess(
<String>['RunnerTests', 'RunnerUITests']), // iOS list
FakeProcessInfo(
MockProcess(), <String>['xcodebuild', 'test']), // iOS run
MockProcess(), <String>['xcodebuild', 'clean', 'test']), // iOS run
getMockXcodebuildListProcess(
<String>['RunnerTests', 'RunnerUITests']), // macOS list
FakeProcessInfo(
MockProcess(), <String>['xcodebuild', 'test']), // macOS run
MockProcess(), <String>['xcodebuild', 'clean', 'test']), // macOS run
];

final List<String> output = await runCapturingPrint(runner, <String>[
Expand Down
8 changes: 8 additions & 0 deletions script/tool/test/xcode_analyze_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ void main() {
'xcrun',
const <String>[
'xcodebuild',
'clean',
'analyze',
'-workspace',
'ios/Runner.xcworkspace',
Expand Down Expand Up @@ -146,6 +147,7 @@ void main() {
'xcrun',
const <String>[
'xcodebuild',
'clean',
'analyze',
'-workspace',
'ios/Runner.xcworkspace',
Expand Down Expand Up @@ -244,6 +246,7 @@ void main() {
'xcrun',
const <String>[
'xcodebuild',
'clean',
'analyze',
'-workspace',
'macos/Runner.xcworkspace',
Expand Down Expand Up @@ -278,6 +281,7 @@ void main() {
'xcrun',
const <String>[
'xcodebuild',
'clean',
'analyze',
'-workspace',
'macos/Runner.xcworkspace',
Expand Down Expand Up @@ -350,6 +354,7 @@ void main() {
'xcrun',
const <String>[
'xcodebuild',
'clean',
'analyze',
'-workspace',
'ios/Runner.xcworkspace',
Expand All @@ -366,6 +371,7 @@ void main() {
'xcrun',
const <String>[
'xcodebuild',
'clean',
'analyze',
'-workspace',
'macos/Runner.xcworkspace',
Expand Down Expand Up @@ -406,6 +412,7 @@ void main() {
'xcrun',
const <String>[
'xcodebuild',
'clean',
'analyze',
'-workspace',
'macos/Runner.xcworkspace',
Expand Down Expand Up @@ -445,6 +452,7 @@ void main() {
'xcrun',
const <String>[
'xcodebuild',
'clean',
'analyze',
'-workspace',
'ios/Runner.xcworkspace',
Expand Down