[flutter_tools] correctly forward error only stdout in non-verbose modes (#63815)

This commit is contained in:
Jonah Williams
2020-08-18 16:56:05 -07:00
committed by GitHub
parent 2122fe1fa1
commit 39c735f408
4 changed files with 19 additions and 7 deletions

View File

@@ -86,7 +86,9 @@ void main() {
'OBJROOT=${fileSystem.path.join(flutterBuildDir.absolute.path, 'Build', 'Intermediates.noindex')}',
'SYMROOT=${fileSystem.path.join(flutterBuildDir.absolute.path, 'Build', 'Products')}',
if (verbose)
'VERBOSE_SCRIPT_LOGGING=YES',
'VERBOSE_SCRIPT_LOGGING=YES'
else
'-quiet',
'COMPILER_INDEX_STORE_ENABLE=NO',
],
stdout: 'STDOUT STUFF',
@@ -129,7 +131,7 @@ void main() {
FeatureFlags: () => TestFeatureFlags(isMacOSEnabled: true),
});
testUsingContext('macOS build does not spew stdout to status logger', () async {
testUsingContext('macOS build forwards error stdout to status logger error', () async {
final BuildCommand command = BuildCommand();
createMinimalMockProjectFiles();
@@ -137,7 +139,8 @@ void main() {
const <String>['build', 'macos', '--debug']
);
expect(testLogger.statusText, isNot(contains('STDOUT STUFF')));
expect(testLogger.traceText, contains('STDOUT STUFF'));
expect(testLogger.traceText, isNot(contains('STDOUT STUFF')));
expect(testLogger.errorText, contains('STDOUT STUFF'));
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[