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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 parser.addFlag('immediate', | 137 parser.addFlag('immediate', |
138 help: 'Print test results immediately, instead of at the end of a test ' | 138 help: 'Print test results immediately, instead of at the end of a test ' |
139 'file. Note that in some async cases this may result in multiple ' | 139 'file. Note that in some async cases this may result in multiple ' |
140 'messages for a single test.', | 140 'messages for a single test.', |
141 defaultsTo: false); | 141 defaultsTo: false); |
142 | 142 |
143 parser.addFlag('regenerate', | 143 parser.addFlag('regenerate', |
144 help: 'Regenerate layout test expectation files.', | 144 help: 'Regenerate layout test expectation files.', |
145 defaultsTo: false); | 145 defaultsTo: false); |
146 | 146 |
| 147 parser.addFlag('server', help: 'Run an HTTP server.', defaultsTo: false); |
| 148 |
| 149 parser.addOption('port', help: 'Port to use for HTTP server', |
| 150 defaultsTo: '80'); |
| 151 |
| 152 parser.addOption('root', |
| 153 help: 'Root directory for HTTP server for static files'); |
| 154 |
147 parser.addOption('unittest', help: '#import path for unit test library.'); | 155 parser.addOption('unittest', help: '#import path for unit test library.'); |
148 | 156 |
149 return parser; | 157 return parser; |
150 } | 158 } |
151 | 159 |
152 /** Print a value option, quoting it if it has embedded spaces. */ | 160 /** Print a value option, quoting it if it has embedded spaces. */ |
153 _printValueOption(String name, value, OutputStream stream) { | 161 _printValueOption(String name, value, OutputStream stream) { |
154 if (value.indexOf(' ') >= 0) { | 162 if (value.indexOf(' ') >= 0) { |
155 stream.writeString("--$name='$value'\n"); | 163 stream.writeString("--$name='$value'\n"); |
156 } else { | 164 } else { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 } | 259 } |
252 if ((config['layout-text'] || config['layout-pixel']) && | 260 if ((config['layout-text'] || config['layout-pixel']) && |
253 config['runtime'] == 'vm') { | 261 config['runtime'] == 'vm') { |
254 print('Layout tests must use --runtime values of "drt-dart" or "drt-js"'); | 262 print('Layout tests must use --runtime values of "drt-dart" or "drt-js"'); |
255 return false; | 263 return false; |
256 } | 264 } |
257 return true; | 265 return true; |
258 } | 266 } |
259 | 267 |
260 | 268 |
OLD | NEW |