From b1330eff5f3659093359f537789b2adcb5e5ea3b Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Mon, 23 Apr 2018 17:08:11 -0700 Subject: [PATCH] Fail test execution if compiler reported errors. (#16895) Fixes https://github.com/flutter/flutter/issues/16496 --- .../flutter_tools/lib/src/test/flutter_platform.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/flutter_tools/lib/src/test/flutter_platform.dart b/packages/flutter_tools/lib/src/test/flutter_platform.dart index f591ead33b6..d46a4f94d82 100644 --- a/packages/flutter_tools/lib/src/test/flutter_platform.dart +++ b/packages/flutter_tools/lib/src/test/flutter_platform.dart @@ -151,11 +151,11 @@ class _Compiler { request.path); final String outputPath = compilerOutput?.outputFilename; - // Check if the compiler produced the output. If it failed then - // outputPath would be null. In this case pass null upwards to the - // consumer and shutdown the compiler to avoid reusing compiler - // that might have gotten into a weird state. - if (outputPath == null) { + // In case compiler didn't produce output or reported compilation + // errors, pass [null] upwards to the consumer and shutdown the + // compiler to avoid reusing compiler that might have gotten into + // a weird state. + if (outputPath == null || compilerOutput.errorCount > 0) { request.result.complete(null); await shutdown(); } else {