Give _runFlutterTest the ability to validate command output

In another change (#37646), I want to test that a test fails and
prints expected output.  I didn't see an existing way to do that, so
I modified `_runFlutterTest` and `runCommand` to allow capturing the
output.  Currently capturing and printing output are mutually
exclusive since we don't need both.

Some awkward bits:
* There already exists a `runAndGetStdout` function that is very
  similar to `runCommand`, and this change makes the conceptual
  distinction more confusing.

* `runFlutterTest` has multiple code paths for different
  configurations.  I don't understand what the different paths are
  for, and I added output checking only along one of them.
This commit is contained in:
James Lin
2019-08-09 15:10:45 -07:00
committed by James D. Lin
parent 01feddbece
commit c02b805cdc
3 changed files with 77 additions and 11 deletions

View File

@@ -585,7 +585,7 @@ Future<void> _verifyGeneratedPluginRegistrants(String flutterRoot) async {
}
await runCommand(flutter, <String>['inject-plugins'],
workingDirectory: package,
printOutput: false,
outputMode: OutputMode.discard,
);
for (File registrant in fileToContent.keys) {
if (registrant.readAsStringSync() != fileToContent[registrant]) {