Unverified Commit bbc9d4f3 authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Do not check the executable status of gen_snapshot if it has not yet been downloaded (#52574)

parent 601c8dbe
......@@ -640,7 +640,8 @@ class FlutterValidator extends DoctorValidator {
globals.artifacts.getArtifactPath(Artifact.genSnapshot);
// Check that the binaries we downloaded for this platform actually run on it.
if (!_genSnapshotRuns(genSnapshotPath)) {
if (globals.fs.file(genSnapshotPath).existsSync()
&& !_genSnapshotRuns(genSnapshotPath)) {
final StringBuffer buf = StringBuffer();
buf.writeln(userMessages.flutterBinariesDoNotRun);
if (globals.platform.isLinux) {
......
......@@ -529,6 +529,16 @@ void main() {
Platform: _kNoColorOutputPlatform,
});
testUsingContext('gen_snapshot binary not available', () async {
expect(await FlutterValidatorDoctor().diagnose(verbose: false), isTrue);
// gen_snapshot is downloaded on demand, and the doctor should not
// fail if the gen_snapshot binary is not present.
expect(testLogger.statusText, contains('No issues found!'));
}, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem(),
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('version checking does not work', () async {
final VersionCheckError versionCheckError = VersionCheckError('version error');
......
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