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
bc7286f1
Unverified
Commit
bc7286f1
authored
Jan 07, 2021
by
Jenn Magder
Committed by
GitHub
Jan 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use simctl exit code instead of stderr (#73070)
parent
273630c0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
4 deletions
+48
-4
xcode.dart
packages/flutter_tools/lib/src/macos/xcode.dart
+1
-1
xcode_test.dart
...es/flutter_tools/test/general.shard/macos/xcode_test.dart
+47
-0
xcode_validator_test.dart
..._tools/test/general.shard/macos/xcode_validator_test.dart
+0
-3
No files found.
packages/flutter_tools/lib/src/macos/xcode.dart
View file @
bc7286f1
...
...
@@ -124,7 +124,7 @@ class Xcode {
final
RunResult
result
=
_processUtils
.
runSync
(
<
String
>[...
xcrunCommand
(),
'simctl'
,
'list'
],
);
_isSimctlInstalled
=
result
.
stderr
==
null
||
result
.
stderr
==
''
;
_isSimctlInstalled
=
result
.
exitCode
==
0
;
}
on
ProcessException
{
_isSimctlInstalled
=
false
;
}
...
...
packages/flutter_tools/test/general.shard/macos/xcode_test.dart
View file @
bc7286f1
...
...
@@ -140,6 +140,53 @@ void main() {
expect
(
xcode
.
isInstalledAndMeetsVersionCheck
,
isFalse
);
});
testWithoutContext
(
'isSimctlInstalled is true when simctl list succeeds'
,
()
{
when
(
mockXcodeProjectInterpreter
.
xcrunCommand
()).
thenReturn
(<
String
>[
'xcrun'
]);
fakeProcessManager
.
addCommand
(
const
FakeCommand
(
command:
<
String
>[
'xcrun'
,
'simctl'
,
'list'
,
],
),
);
final
Xcode
xcode
=
Xcode
(
logger:
logger
,
platform:
FakePlatform
(
operatingSystem:
'macos'
),
fileSystem:
MemoryFileSystem
.
test
(),
processManager:
fakeProcessManager
,
xcodeProjectInterpreter:
mockXcodeProjectInterpreter
,
);
expect
(
xcode
.
isSimctlInstalled
,
isTrue
);
expect
(
fakeProcessManager
.
hasRemainingExpectations
,
isFalse
);
});
testWithoutContext
(
'isSimctlInstalled is true when simctl list fails'
,
()
{
when
(
mockXcodeProjectInterpreter
.
xcrunCommand
()).
thenReturn
(<
String
>[
'xcrun'
]);
fakeProcessManager
.
addCommand
(
const
FakeCommand
(
command:
<
String
>[
'xcrun'
,
'simctl'
,
'list'
,
],
exitCode:
1
,
),
);
final
Xcode
xcode
=
Xcode
(
logger:
logger
,
platform:
FakePlatform
(
operatingSystem:
'macos'
),
fileSystem:
MemoryFileSystem
.
test
(),
processManager:
fakeProcessManager
,
xcodeProjectInterpreter:
mockXcodeProjectInterpreter
,
);
expect
(
xcode
.
isSimctlInstalled
,
isFalse
);
expect
(
fakeProcessManager
.
hasRemainingExpectations
,
isFalse
);
});
group
(
'macOS'
,
()
{
Xcode
xcode
;
FakePlatform
platform
;
...
...
packages/flutter_tools/test/general.shard/macos/xcode_validator_test.dart
View file @
bc7286f1
...
...
@@ -7,12 +7,9 @@ import 'package:flutter_tools/src/doctor.dart';
import
'package:flutter_tools/src/macos/xcode.dart'
;
import
'package:flutter_tools/src/macos/xcode_validator.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:process/process.dart'
;
import
'../../src/common.dart'
;
import
'../../src/context.dart'
;
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
class
MockXcode
extends
Mock
implements
Xcode
{}
void
main
(
)
{
...
...
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