Skip to content

Commit

Permalink
Fix mac tool_integration_tests with Xcode 15 (#133217)
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherfujino authored Aug 24, 2023
1 parent 9632f82 commit 12cf9de
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion packages/flutter_tools/test/integration.shard/test_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,10 @@ Future<void> _testFile(
reason: '"$testName" returned code ${exec.exitCode}\n\nstdout:\n'
'${exec.stdout}\nstderr:\n${exec.stderr}',
);
final List<String> output = (exec.stdout as String).split('\n');
List<String> output = (exec.stdout as String).split('\n');

output = _removeMacFontServerWarning(output);

if (output.first.startsWith('Waiting for another flutter command to release the startup lock...')) {
output.removeAt(0);
}
Expand Down Expand Up @@ -398,6 +401,26 @@ Future<void> _testFile(
}
}

final RegExp _fontServerProtocolPattern = RegExp(r'flutter_tester.*Font server protocol version mismatch');
final RegExp _unableToConnectToFontDaemonPattern = RegExp(r'flutter_tester.*XType: unable to make a connection to the font daemon!');
final RegExp _xtFontStaticRegistryPattern = RegExp(r'flutter_tester.*XType: XTFontStaticRegistry is enabled as fontd is not available');

// https://github.com/flutter/flutter/issues/132990
List<String> _removeMacFontServerWarning(List<String> output) {
return output.where((String line) {
if (_fontServerProtocolPattern.hasMatch(line)) {
return false;
}
if (_unableToConnectToFontDaemonPattern.hasMatch(line)) {
return false;
}
if (_xtFontStaticRegistryPattern.hasMatch(line)) {
return false;
}
return true;
}).toList();
}

Future<ProcessResult> _runFlutterTest(
String? testName,
String workingDirectory,
Expand Down

0 comments on commit 12cf9de

Please sign in to comment.