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
7634a0ec
Unverified
Commit
7634a0ec
authored
Jan 30, 2019
by
Zachary Anderson
Committed by
GitHub
Jan 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tool,doctor] Fix and test gen_snapshot failure message (#27253)
parent
327e3eff
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
4 deletions
+51
-4
user_messages.dart
packages/flutter_tools/lib/src/base/user_messages.dart
+1
-1
doctor.dart
packages/flutter_tools/lib/src/doctor.dart
+3
-3
doctor_test.dart
packages/flutter_tools/test/commands/doctor_test.dart
+47
-0
No files found.
packages/flutter_tools/lib/src/base/user_messages.dart
View file @
7634a0ec
...
...
@@ -19,7 +19,7 @@ class UserMessages {
String
get
flutterBinariesLinuxRepairCommands
=>
'On Debian/Ubuntu/Mint: sudo apt-get install lib32stdc++6
\n
'
'On Fedora: dnf install libstdc++.i686
\n
'
'On Arch: pacman -S lib32-libstdc++5'
;
'On Arch: pacman -S lib32-libstdc++5
(you need to enable multilib: https://wiki.archlinux.org/index.php/Official_repositories#multilib)
'
;
// Messages used in NoIdeValidator
String
get
noIdeStatusInfo
=>
'No supported IDEs installed'
;
...
...
packages/flutter_tools/lib/src/doctor.dart
View file @
7634a0ec
...
...
@@ -50,7 +50,7 @@ class _DefaultDoctorValidatorsProvider implements DoctorValidatorsProvider {
List
<
DoctorValidator
>
get
validators
{
if
(
_validators
==
null
)
{
_validators
=
<
DoctorValidator
>[];
_validators
.
add
(
_
FlutterValidator
());
_validators
.
add
(
FlutterValidator
());
if
(
androidWorkflow
.
appliesToHostPlatform
)
_validators
.
add
(
GroupedValidator
(<
DoctorValidator
>[
androidValidator
,
androidLicenseValidator
]));
...
...
@@ -438,8 +438,8 @@ class ValidationMessage {
String
toString
()
=>
message
;
}
class
_
FlutterValidator
extends
DoctorValidator
{
_
FlutterValidator
()
:
super
(
'Flutter'
);
class
FlutterValidator
extends
DoctorValidator
{
FlutterValidator
()
:
super
(
'Flutter'
);
@override
Future
<
ValidationResult
>
validate
()
async
{
...
...
packages/flutter_tools/test/commands/doctor_test.dart
View file @
7634a0ec
...
...
@@ -4,10 +4,17 @@
import
'dart:async'
;
import
'package:mockito/mockito.dart'
;
import
'package:process/process.dart'
;
import
'package:flutter_tools/src/artifacts.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/base/terminal.dart'
;
import
'package:flutter_tools/src/base/user_messages.dart'
;
import
'package:flutter_tools/src/doctor.dart'
;
import
'package:flutter_tools/src/globals.dart'
;
import
'package:flutter_tools/src/proxy_validator.dart'
;
import
'package:flutter_tools/src/vscode/vscode.dart'
;
import
'package:flutter_tools/src/vscode/vscode_validator.dart'
;
...
...
@@ -21,6 +28,12 @@ final Map<Type, Generator> noColorTerminalOverride = <Type, Generator>{
};
void
main
(
)
{
MockProcessManager
mockProcessManager
;
setUp
(()
{
mockProcessManager
=
MockProcessManager
();
});
group
(
'doctor'
,
()
{
testUsingContext
(
'intellij validator'
,
()
async
{
const
String
installPath
=
'/path/to/intelliJ'
;
...
...
@@ -290,6 +303,29 @@ void main() {
'! Doctor found issues in 4 categories.
\n
'
));
},
overrides:
noColorTerminalOverride
);
testUsingContext
(
'gen_snapshot does not work'
,
()
async
{
when
(
mockProcessManager
.
runSync
(
<
String
>[
artifacts
.
getArtifactPath
(
Artifact
.
genSnapshot
)],
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
anyNamed
(
'environment'
),
)).
thenReturn
(
ProcessResult
(
101
,
1
,
''
,
''
));
expect
(
await
FlutterValidatorDoctor
().
diagnose
(
verbose:
false
),
isTrue
);
final
List
<
String
>
statusLines
=
testLogger
.
statusText
.
split
(
'
\n
'
);
for
(
String
msg
in
userMessages
.
flutterBinariesDoNotRun
.
split
(
'
\n
'
))
{
expect
(
statusLines
,
contains
(
contains
(
msg
)));
}
if
(
platform
.
isLinux
)
{
for
(
String
msg
in
userMessages
.
flutterBinariesLinuxRepairCommands
.
split
(
'
\n
'
))
{
expect
(
statusLines
,
contains
(
contains
(
msg
)));
}
}
},
overrides:
<
Type
,
Generator
>{
OutputPreferences:
()
=>
OutputPreferences
(
wrapText:
false
),
ProcessManager:
()
=>
mockProcessManager
,
Platform:
_kNoColorOutputPlatform
,
});
});
testUsingContext
(
'validate non-verbose output wrapping'
,
()
async
{
...
...
@@ -687,6 +723,15 @@ class FakeGroupedDoctorWithStatus extends Doctor {
}
}
class
FlutterValidatorDoctor
extends
Doctor
{
List
<
DoctorValidator
>
_validators
;
@override
List
<
DoctorValidator
>
get
validators
{
_validators
??=
<
DoctorValidator
>[
FlutterValidator
()];
return
_validators
;
}
}
/// A doctor that takes any two validators. Used to check behavior when
/// merging ValidationTypes (installed, missing, partial).
class
FakeSmallGroupDoctor
extends
Doctor
{
...
...
@@ -717,3 +762,5 @@ class VsCodeValidatorTestTargets extends VsCodeValidator {
static
final
String
validExtensions
=
fs
.
path
.
join
(
'test'
,
'data'
,
'vscode'
,
'extensions'
);
static
final
String
missingExtensions
=
fs
.
path
.
join
(
'test'
,
'data'
,
'vscode'
,
'notExtensions'
);
}
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
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