| 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 24 matching lines...) Expand all Loading... |
| 35 parser.addOption('tasks', abbr: 'j', | 35 parser.addOption('tasks', abbr: 'j', |
| 36 defaultsTo: Platform.numberOfProcessors.toString(), | 36 defaultsTo: Platform.numberOfProcessors.toString(), |
| 37 help: 'The number of parallel tasks to run.'); | 37 help: 'The number of parallel tasks to run.'); |
| 38 | 38 |
| 39 parser.addOption('out', abbr: 'o', defaultsTo: 'stdout', | 39 parser.addOption('out', abbr: 'o', defaultsTo: 'stdout', |
| 40 help: 'File to send test results. This should be a ' | 40 help: 'File to send test results. This should be a ' |
| 41 'file name or one of stdout, stderr, or none.'); | 41 'file name or one of stdout, stderr, or none.'); |
| 42 | 42 |
| 43 parser.addOption('list-format', | 43 parser.addOption('list-format', |
| 44 defaultsTo: | 44 defaultsTo: |
| 45 '${Macros.testfile}${Macros.testGroup}${Macros.testDescription}', | 45 '<FILENAME><GROUPNAME><TESTNAME>', |
| 46 help: 'Format for test list result output.'); | 46 help: 'Format for test list result output.'); |
| 47 | 47 |
| 48 parser.addOption('pass-format', | 48 parser.addOption('pass-format', |
| 49 defaultsTo: 'PASS ${Macros.testTime}' | 49 defaultsTo: 'PASS <TIME><FILENAME><GROUPNAME><TESTNAME><MESSAGE>', |
| 50 '${Macros.testfile}${Macros.testGroup}' | |
| 51 '${Macros.testDescription}${Macros.testMessage}', | |
| 52 help: 'Format for passing test result output.'); | 50 help: 'Format for passing test result output.'); |
| 53 | 51 |
| 54 parser.addOption('fail-format', | 52 parser.addOption('fail-format', |
| 55 defaultsTo: 'FAIL ${Macros.testTime}' | 53 defaultsTo: 'FAIL <TIME><FILENAME><GROUPNAME><TESTNAME><MESSAGE>', |
| 56 '${Macros.testfile}${Macros.testGroup}' | |
| 57 '${Macros.testDescription}${Macros.testMessage}', | |
| 58 help: 'Format for failed test result output.'); | 54 help: 'Format for failed test result output.'); |
| 59 | 55 |
| 60 parser.addOption('error-format', | 56 parser.addOption('error-format', |
| 61 defaultsTo: 'ERROR ${Macros.testTime}' | 57 defaultsTo: 'ERROR <TIME><FILENAME><GROUPNAME><TESTNAME><MESSAGE>', |
| 62 '${Macros.testfile}${Macros.testGroup}' | |
| 63 '${Macros.testDescription}${Macros.testMessage}', | |
| 64 help: 'Format for tests with errors result output.'); | 58 help: 'Format for tests with errors result output.'); |
| 65 | 59 |
| 66 parser.addFlag('summary', defaultsTo: false, | 60 parser.addFlag('summary', defaultsTo: false, |
| 67 help: 'Print a summary of tests passed/failed for each test file.'); | 61 help: 'Print a summary of tests passed/failed for each test file.'); |
| 68 | 62 |
| 69 parser.addOption('log', abbr: 'l', defaultsTo: 'none', | 63 parser.addOption('log', abbr: 'l', defaultsTo: 'none', |
| 70 help: 'File to send test log/print output to. This should be a ' | 64 help: 'File to send test log/print output to. This should be a ' |
| 71 'file name or one of stdout, stderr, or none.'); | 65 'file name or one of stdout, stderr, or none.'); |
| 72 | 66 |
| 73 // TODO(gram) - add loglevel once we have switched unittest to use the log | 67 // TODO(gram) - add loglevel once we have switched unittest to use the log |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 parser.addFlag('server', help: 'Run an HTTP server.', defaultsTo: false); | 141 parser.addFlag('server', help: 'Run an HTTP server.', defaultsTo: false); |
| 148 | 142 |
| 149 parser.addOption('port', help: 'Port to use for HTTP server', | 143 parser.addOption('port', help: 'Port to use for HTTP server', |
| 150 defaultsTo: '80'); | 144 defaultsTo: '80'); |
| 151 | 145 |
| 152 parser.addOption('root', | 146 parser.addOption('root', |
| 153 help: 'Root directory for HTTP server for static files'); | 147 help: 'Root directory for HTTP server for static files'); |
| 154 | 148 |
| 155 parser.addOption('unittest', help: '#import path for unit test library.'); | 149 parser.addOption('unittest', help: '#import path for unit test library.'); |
| 156 | 150 |
| 151 parser.addOption('pipeline', |
| 152 help: 'Pipeline script to use to run each test file.', |
| 153 defaultsTo: 'run_pipeline.dart'); |
| 154 |
| 157 return parser; | 155 return parser; |
| 158 } | 156 } |
| 159 | 157 |
| 160 /** Print a value option, quoting it if it has embedded spaces. */ | 158 /** Print a value option, quoting it if it has embedded spaces. */ |
| 161 _printValueOption(String name, value, OutputStream stream) { | 159 _printValueOption(String name, value, OutputStream stream) { |
| 162 if (value.indexOf(' ') >= 0) { | 160 if (value.indexOf(' ') >= 0) { |
| 163 stream.writeString("--$name='$value'\n"); | 161 stream.writeString("--$name='$value'\n"); |
| 164 } else { | 162 } else { |
| 165 stream.writeString("--$name=$value\n"); | 163 stream.writeString("--$name=$value\n"); |
| 166 } | 164 } |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 } | 257 } |
| 260 if ((config['layout-text'] || config['layout-pixel']) && | 258 if ((config['layout-text'] || config['layout-pixel']) && |
| 261 config['runtime'] == 'vm') { | 259 config['runtime'] == 'vm') { |
| 262 print('Layout tests must use --runtime values of "drt-dart" or "drt-js"'); | 260 print('Layout tests must use --runtime values of "drt-dart" or "drt-js"'); |
| 263 return false; | 261 return false; |
| 264 } | 262 } |
| 265 return true; | 263 return true; |
| 266 } | 264 } |
| 267 | 265 |
| 268 | 266 |
| OLD | NEW |