| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /// Collects the configurations for all status files in the 'tests' folder that | 5 /// Collects the configurations for all status files in the 'tests' folder that |
| 6 /// mention one of the test names given as argument. | 6 /// mention one of the test names given as argument. |
| 7 | 7 |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'dart:math' hide log; | 9 import 'dart:math' hide log; |
| 10 import 'dart:io'; | 10 import 'dart:io'; |
| 11 | 11 |
| 12 import 'package:args/args.dart'; | 12 import 'package:args/args.dart'; |
| 13 import 'package:gardening/src/util.dart'; | 13 import 'package:gardening/src/util.dart'; |
| 14 | 14 |
| 15 void help(ArgParser argParser) { | 15 void help(ArgParser argParser) { |
| 16 print('Prints all status-file entries for the given tests.'); | 16 print('Prints all status-file entries for the given tests.'); |
| 17 print('The test-names must be a substring (or full match) of the lines in '); | 17 print('The test-names must be a substring (or full match) of the lines in '); |
| 18 print('the status file. They can not be fully qualified'); | 18 print('the status file. They can not be fully qualified'); |
| 19 print('Usage: status_summary [options] <test-name1> [<test-name2> ...]'); | 19 print('Usage: status_summary [options] <test-name1> [<test-name2> ...]'); |
| 20 print('where options are:'); | 20 print('where options are:'); |
| 21 print(argParser.usage); | 21 print(argParser.usage); |
| 22 } | 22 } |
| 23 | 23 |
| 24 main(List<String> args) async { | 24 Future main(List<String> args) async { |
| 25 ArgParser argParser = createArgParser(); | 25 ArgParser argParser = createArgParser(); |
| 26 ArgResults argResults = argParser.parse(args); | 26 ArgResults argResults = argParser.parse(args); |
| 27 processArgResults(argResults); | 27 processArgResults(argResults); |
| 28 if (argResults.rest.length == 0 || argResults['help']) { | 28 if (argResults.rest.length == 0 || argResults['help']) { |
| 29 help(argParser); | 29 help(argParser); |
| 30 if (argResults['help']) return; | 30 if (argResults['help']) return; |
| 31 exit(1); | 31 exit(1); |
| 32 } | 32 } |
| 33 int maxStatusWidth = 0; | 33 int maxStatusWidth = 0; |
| 34 int maxConfigWidth = 0; | 34 int maxConfigWidth = 0; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 /// The status of the entry, e.g. `Pass, Slow`. | 128 /// The status of the entry, e.g. `Pass, Slow`. |
| 129 final String status; | 129 final String status; |
| 130 | 130 |
| 131 /// The comment after the status, if any. | 131 /// The comment after the status, if any. |
| 132 final String comment; | 132 final String comment; |
| 133 | 133 |
| 134 StatusEntry(this.config, this.status, this.comment); | 134 StatusEntry(this.config, this.status, this.comment); |
| 135 | 135 |
| 136 String toString() => '$status $config $comment'; | 136 String toString() => '$status $config $comment'; |
| 137 } | 137 } |
| OLD | NEW |