Unverified Commit aa6cc071 authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Be clearer about errors in customer testing script (#36098)

parent bade97c4
...@@ -47,7 +47,23 @@ Future<bool> run(List<String> arguments) async { ...@@ -47,7 +47,23 @@ Future<bool> run(List<String> arguments) async {
help: 'Print this help message.', help: 'Print this help message.',
); );
final ArgResults parsedArguments = argParser.parse(arguments); void printHelp() {
print('run_tests.dart [options...] path/to/file1.test path/to/file2.test...');
print('For details on the test registry format, see:');
print(' https://github.com/flutter/tests/blob/master/registry/template.test');
print('');
print(argParser.usage);
print('');
}
ArgResults parsedArguments;
try {
parsedArguments = argParser.parse(arguments);
} on ArgParserException catch (error) {
printHelp();
print('Error: ${error.message} Use --help for usage information.');
exit(1);
}
final int repeat = int.tryParse(parsedArguments['repeat']); final int repeat = int.tryParse(parsedArguments['repeat']);
final bool skipOnFetchFailure = parsedArguments['skip-on-fetch-failure']; final bool skipOnFetchFailure = parsedArguments['skip-on-fetch-failure'];
...@@ -62,12 +78,16 @@ Future<bool> run(List<String> arguments) async { ...@@ -62,12 +78,16 @@ Future<bool> run(List<String> arguments) async {
.toList(); .toList();
if (help || repeat == null || files.isEmpty) { if (help || repeat == null || files.isEmpty) {
print('run_tests.dart [options...] path/to/file1.test path/to/file2.test...'); printHelp();
print('For details on the test registry format, see:'); if (verbose) {
print(' https://github.com/flutter/tests/blob/master/registry/template.test'); if (repeat == null)
print(''); print('Error: Could not parse repeat count ("${parsedArguments['repeat']}")');
print(argParser.usage); if (parsedArguments.rest.isEmpty) {
print(''); print('Error: No file arguments specified.');
} else if (files.isEmpty) {
print('Error: File arguments ("${parsedArguments.rest.join("\", \"")}") did not identify any real files.');
}
}
return help; return help;
} }
......
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