Support failures-only and silent reporters in flutter test (#148739)

Fixes #148738.

Also add some tests for this part of the `flutter test` CLI.
This commit is contained in:
Greg Price
2024-06-03 12:44:39 -07:00
committed by GitHub
parent 691a18df5f
commit 5e448f4ce5
2 changed files with 61 additions and 2 deletions

View File

@@ -216,12 +216,14 @@ class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts {
..addOption('reporter',
abbr: 'r',
help: 'Set how to print test results. If unset, value will default to either compact or expanded.',
allowed: <String>['compact', 'expanded', 'github', 'json'],
allowed: <String>['compact', 'expanded', 'failures-only', 'github', 'json', 'silent'],
allowedHelp: <String, String>{
'compact': 'A single line that updates dynamically (The default reporter).',
'compact': 'A single line, updated continuously (the default).',
'expanded': 'A separate line for each update. May be preferred when logging to a file or in continuous integration.',
'failures-only': 'A separate line for failing tests, with no output for passing tests.',
'github': 'A custom reporter for GitHub Actions (the default reporter when running on GitHub Actions).',
'json': 'A machine-readable format. See: https://dart.dev/go/test-docs/json_reporter.md',
'silent': 'A reporter with no output. May be useful when only the exit code is meaningful.'
},
)
..addOption('file-reporter',