[flutter_tools] process exception during linux_doctor is handled (#100159)
This commit is contained in:
parent
b39a9473f8
commit
03b4f2bf50
@ -169,6 +169,8 @@ class LinuxDoctorValidator extends DoctorValidator {
|
|||||||
]);
|
]);
|
||||||
} on ArgumentError {
|
} on ArgumentError {
|
||||||
// ignore error.
|
// ignore error.
|
||||||
|
} on ProcessException {
|
||||||
|
// ignore error.
|
||||||
}
|
}
|
||||||
if (result == null || result.exitCode != 0) {
|
if (result == null || result.exitCode != 0) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
import 'package:flutter_tools/src/base/io.dart';
|
||||||
import 'package:flutter_tools/src/base/user_messages.dart';
|
import 'package:flutter_tools/src/base/user_messages.dart';
|
||||||
import 'package:flutter_tools/src/doctor_validator.dart';
|
import 'package:flutter_tools/src/doctor_validator.dart';
|
||||||
import 'package:flutter_tools/src/linux/linux_doctor.dart';
|
import 'package:flutter_tools/src/linux/linux_doctor.dart';
|
||||||
@ -90,6 +91,14 @@ FakeCommand _missingBinaryCommand(String binary) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FakeCommand _missingBinaryException(String binary) {
|
||||||
|
return FakeCommand(
|
||||||
|
command: <String>[binary, '--version'],
|
||||||
|
exitCode: 1,
|
||||||
|
exception: ProcessException(binary, <String>[])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
testWithoutContext('Full validation when everything is available at the necessary version',() async {
|
testWithoutContext('Full validation when everything is available at the necessary version',() async {
|
||||||
final ProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
final ProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||||
@ -260,7 +269,7 @@ void main() {
|
|||||||
|
|
||||||
testWithoutContext('Missing validation when clang++ is not available', () async {
|
testWithoutContext('Missing validation when clang++ is not available', () async {
|
||||||
final ProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
final ProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||||
_missingBinaryCommand('clang++'),
|
_missingBinaryException('clang++'),
|
||||||
_cmakePresentCommand('3.16.3'),
|
_cmakePresentCommand('3.16.3'),
|
||||||
_ninjaPresentCommand('1.10.0'),
|
_ninjaPresentCommand('1.10.0'),
|
||||||
_pkgConfigPresentCommand('0.29'),
|
_pkgConfigPresentCommand('0.29'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user