Unverified Commit 03b4f2bf authored by Jesús S Guerrero's avatar Jesús S Guerrero Committed by GitHub

[flutter_tools] process exception during linux_doctor is handled (#100159)

parent b39a9473
...@@ -169,6 +169,8 @@ class LinuxDoctorValidator extends DoctorValidator { ...@@ -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 @@ ...@@ -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) { ...@@ -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() { ...@@ -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'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment