OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** Create and return an options parser for the test runner. */ | 5 /** Create and return an options parser for the test runner. */ |
6 ArgParser getOptionParser() { | 6 ArgParser getOptionParser() { |
7 var parser = new ArgParser(); | 7 var parser = new ArgParser(); |
8 | 8 |
9 parser.addOption('help', abbr: '?', | 9 parser.addOption('help', abbr: '?', |
10 help: 'Show usage information.'); | 10 help: 'Show usage information.'); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 } | 213 } |
214 } | 214 } |
215 } | 215 } |
216 // Finally, we add options from the command line. These have the highest | 216 // Finally, we add options from the command line. These have the highest |
217 // precedence of all. | 217 // precedence of all. |
218 options.addAll(commandLineArgs); | 218 options.addAll(commandLineArgs); |
219 // Now try parse the whole collection of options, and if this fails, | 219 // Now try parse the whole collection of options, and if this fails, |
220 // issue a usage message. | 220 // issue a usage message. |
221 try { | 221 try { |
222 return optionsParser.parse(options); | 222 return optionsParser.parse(options); |
223 } catch (var e) { | 223 } catch (e) { |
224 print(e); | 224 print(e); |
225 print('Usage: testrunner <options> [<directory or file> ...]'); | 225 print('Usage: testrunner <options> [<directory or file> ...]'); |
226 print(optionsParser.getUsage()); | 226 print(optionsParser.getUsage()); |
227 return null; | 227 return null; |
228 } | 228 } |
229 } | 229 } |
230 | 230 |
231 /** Perform some sanity checking of the configuration. */ | 231 /** Perform some sanity checking of the configuration. */ |
232 bool isSane(ArgResults config) { | 232 bool isSane(ArgResults config) { |
233 if (config == null) { | 233 if (config == null) { |
(...skipping 13 matching lines...) Expand all Loading... |
247 return false; | 247 return false; |
248 } | 248 } |
249 if (config['layout'] && config['runtime'] == 'vm') { | 249 if (config['layout'] && config['runtime'] == 'vm') { |
250 print('Layout tests must use --runtime values of "drt-dart" or "drt-js"'); | 250 print('Layout tests must use --runtime values of "drt-dart" or "drt-js"'); |
251 return false; | 251 return false; |
252 } | 252 } |
253 return true; | 253 return true; |
254 } | 254 } |
255 | 255 |
256 | 256 |
OLD | NEW |