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
4c417884
Unverified
Commit
4c417884
authored
May 14, 2022
by
Christopher Fujino
Committed by
GitHub
May 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] ensure linux doctor validator finishes when pkg-config is not installed (#103755)
parent
4f964196
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
linux_doctor.dart
packages/flutter_tools/lib/src/linux/linux_doctor.dart
+2
-0
linux_doctor_test.dart
...ter_tools/test/general.shard/linux/linux_doctor_test.dart
+24
-0
No files found.
packages/flutter_tools/lib/src/linux/linux_doctor.dart
View file @
4c417884
...
...
@@ -127,6 +127,8 @@ class LinuxDoctorValidator extends DoctorValidator {
final
_VersionInfo
?
version
=
installedVersions
[
kPkgConfigBinary
];
if
(
version
==
null
||
version
.
number
==
null
)
{
messages
.
add
(
ValidationMessage
.
error
(
_userMessages
.
pkgConfigMissing
));
// Exit early because we cannot validate libraries without pkg-config.
return
ValidationResult
(
validationType
,
messages
);
}
else
{
assert
(
_requiredBinaryVersions
.
containsKey
(
kPkgConfigBinary
));
// The full version description is just the number, so add context.
...
...
packages/flutter_tools/test/general.shard/linux/linux_doctor_test.dart
View file @
4c417884
...
...
@@ -219,6 +219,30 @@ void main() {
]);
});
testWithoutContext
(
'Missing validation when pkg-config is missing'
,
()
async
{
final
UserMessages
userMessages
=
UserMessages
();
final
ProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
_clangPresentCommand
(
'4.0.1'
),
_cmakePresentCommand
(
'3.16.3'
),
_ninjaPresentCommand
(
'1.10.0'
),
_missingBinaryException
(
'pkg-config'
),
// We never check libraries because pkg-config is not present
]);
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
processManager:
processManager
,
userMessages:
userMessages
,
);
final
ValidationResult
result
=
await
linuxDoctorValidator
.
validate
();
expect
(
result
.
type
,
ValidationType
.
missing
);
expect
(
result
.
messages
,
<
ValidationMessage
>[
const
ValidationMessage
(
'clang version 4.0.1-6+build1'
),
const
ValidationMessage
(
'cmake version 3.16.3'
),
const
ValidationMessage
(
'ninja version 1.10.0'
),
ValidationMessage
.
error
(
userMessages
.
pkgConfigMissing
),
]);
});
testWithoutContext
(
'Missing validation when CMake is not available'
,
()
async
{
final
ProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
_clangPresentCommand
(
'4.0.1'
),
...
...
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