Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
b279ff41
Unverified
Commit
b279ff41
authored
Oct 27, 2021
by
Jenn Magder
Committed by
GitHub
Oct 27, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run flutter tester with arch -x86_64 on arm64 Mac (#92508)
parent
5eacd89f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
88 additions
and
2 deletions
+88
-2
flutter_tester_device.dart
...ges/flutter_tools/lib/src/test/flutter_tester_device.dart
+16
-1
flutter_tester_device_test.dart
..._tools/test/general.shard/flutter_tester_device_test.dart
+72
-1
No files found.
packages/flutter_tools/lib/src/test/flutter_tester_device.dart
View file @
b279ff41
...
...
@@ -16,6 +16,7 @@ import '../base/common.dart';
import
'../base/file_system.dart'
;
import
'../base/io.dart'
;
import
'../base/logger.dart'
;
import
'../base/os.dart'
;
import
'../base/platform.dart'
;
import
'../convert.dart'
;
import
'../device.dart'
;
...
...
@@ -46,7 +47,13 @@ class FlutterTesterTestDevice extends TestDevice {
})
:
assert
(
shellPath
!=
null
),
// Please provide the path to the shell in the SKY_SHELL environment variable.
assert
(!
debuggingOptions
.
startPaused
||
enableObservatory
),
_gotProcessObservatoryUri
=
enableObservatory
?
Completer
<
Uri
>()
:
(
Completer
<
Uri
>()..
complete
(
null
));
?
Completer
<
Uri
>()
:
(
Completer
<
Uri
>()..
complete
(
null
)),
_operatingSystemUtils
=
OperatingSystemUtils
(
fileSystem:
fileSystem
,
logger:
logger
,
platform:
platform
,
processManager:
processManager
,
);
/// Used for logging to identify the test that is currently being executed.
final
int
id
;
...
...
@@ -70,6 +77,7 @@ class FlutterTesterTestDevice extends TestDevice {
Process
_process
;
HttpServer
_server
;
final
OperatingSystemUtils
_operatingSystemUtils
;
/// Starts the device.
///
...
...
@@ -87,6 +95,13 @@ class FlutterTesterTestDevice extends TestDevice {
logger
.
printTrace
(
'test
$id
: test harness socket server is running at port:
${_server.port}
'
);
final
List
<
String
>
command
=
<
String
>[
// Until an arm64 flutter tester binary is available, force to run in Rosetta
// to avoid "unexpectedly got a signal in sigtramp" crash.
// https://github.com/flutter/flutter/issues/88106
if
(
_operatingSystemUtils
.
hostPlatform
==
HostPlatform
.
darwin_arm
)
...<
String
>[
'/usr/bin/arch'
,
'-x86_64'
,
],
shellPath
,
if
(
enableObservatory
)
...<
String
>[
// Some systems drive the _FlutterPlatform class in an unusual way, where
...
...
packages/flutter_tools/test/general.shard/flutter_tester_device_test.dart
View file @
b279ff41
...
...
@@ -51,9 +51,66 @@ void main() {
dartEntrypointArgs:
dartEntrypointArgs
,
);
testUsingContext
(
'runs in Rosetta on arm64 Mac'
,
()
async
{
final
FakeProcessManager
processManager
=
FakeProcessManager
.
empty
();
final
FlutterTesterTestDevice
device
=
TestFlutterTesterDevice
(
platform:
FakePlatform
(
operatingSystem:
'macos'
),
fileSystem:
fileSystem
,
processManager:
processManager
,
enableObservatory:
false
,
dartEntrypointArgs:
const
<
String
>[],
);
processManager
.
addCommands
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'which'
,
'sysctl'
,
],
),
const
FakeCommand
(
command:
<
String
>[
'sysctl'
,
'hw.optional.arm64'
,
],
stdout:
'hw.optional.arm64: 1'
,
),
FakeCommand
(
command:
const
<
String
>[
'/usr/bin/arch'
,
'-x86_64'
,
'/'
,
'--disable-observatory'
,
'--ipv6'
,
'--enable-checked-mode'
,
'--verify-entry-points'
,
'--enable-software-rendering'
,
'--skia-deterministic-rendering'
,
'--enable-dart-profiling'
,
'--non-interactive'
,
'--use-test-fonts'
,
'--packages=.dart_tool/package_config.json'
,
'example.dill'
,
],
environment:
<
String
,
String
>{
'FLUTTER_TEST'
:
'true'
,
'FONTCONFIG_FILE'
:
device
.
fontConfigManager
.
fontConfigFile
.
path
,
'SERVER_PORT'
:
'0'
,
'APP_NAME'
:
''
,
}),
]);
await
device
.
start
(
'example.dill'
);
expect
(
processManager
.
hasRemainingExpectations
,
isFalse
);
});
group
(
'The FLUTTER_TEST environment variable is passed to the test process'
,
()
{
setUp
(()
{
processManager
=
FakeProcessManager
.
empty
();
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'uname'
,
'-m'
,
],
stdout:
'x86_64'
,
),
]);
device
=
createDevice
();
fileSystem
...
...
@@ -127,6 +184,13 @@ void main() {
group
(
'Dart Entrypoint Args'
,
()
{
setUp
(()
{
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'uname'
,
'-m'
,
],
stdout:
'x86_64'
,
),
const
FakeCommand
(
command:
<
String
>[
'/'
,
...
...
@@ -161,6 +225,13 @@ void main() {
group
(
'DDS'
,
()
{
setUp
(()
{
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'uname'
,
'-m'
,
],
stdout:
'x86_64'
,
),
const
FakeCommand
(
command:
<
String
>[
'/'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment