|
15 | 15 | // simplest interface possible for representing and running tests |
16 | 16 | // while providing a base that other test frameworks may build off of. |
17 | 17 |
|
| 18 | +extern mod getopts; |
18 | 19 | extern mod term; |
19 | 20 |
|
20 | | -use getopts; |
21 | | -use getopts::groups; |
22 | 21 | use json::ToJson; |
23 | 22 | use json; |
24 | 23 | use serialize::Decodable; |
@@ -209,29 +208,29 @@ pub struct TestOpts { |
209 | 208 | /// Result of parsing the options. |
210 | 209 | pub type OptRes = Result<TestOpts, ~str>; |
211 | 210 |
|
212 | | -fn optgroups() -> ~[getopts::groups::OptGroup] { |
213 | | - ~[groups::optflag("", "ignored", "Run ignored tests"), |
214 | | - groups::optflag("", "test", "Run tests and not benchmarks"), |
215 | | - groups::optflag("", "bench", "Run benchmarks instead of tests"), |
216 | | - groups::optflag("h", "help", "Display this message (longer with --help)"), |
217 | | - groups::optopt("", "save-metrics", "Location to save bench metrics", |
| 211 | +fn optgroups() -> ~[getopts::OptGroup] { |
| 212 | + ~[getopts::optflag("", "ignored", "Run ignored tests"), |
| 213 | + getopts::optflag("", "test", "Run tests and not benchmarks"), |
| 214 | + getopts::optflag("", "bench", "Run benchmarks instead of tests"), |
| 215 | + getopts::optflag("h", "help", "Display this message (longer with --help)"), |
| 216 | + getopts::optopt("", "save-metrics", "Location to save bench metrics", |
218 | 217 | "PATH"), |
219 | | - groups::optopt("", "ratchet-metrics", |
| 218 | + getopts::optopt("", "ratchet-metrics", |
220 | 219 | "Location to load and save metrics from. The metrics \ |
221 | 220 | loaded are cause benchmarks to fail if they run too \ |
222 | 221 | slowly", "PATH"), |
223 | | - groups::optopt("", "ratchet-noise-percent", |
| 222 | + getopts::optopt("", "ratchet-noise-percent", |
224 | 223 | "Tests within N% of the recorded metrics will be \ |
225 | 224 | considered as passing", "PERCENTAGE"), |
226 | | - groups::optopt("", "logfile", "Write logs to the specified file instead \ |
| 225 | + getopts::optopt("", "logfile", "Write logs to the specified file instead \ |
227 | 226 | of stdout", "PATH"), |
228 | | - groups::optopt("", "test-shard", "run shard A, of B shards, worth of the testsuite", |
| 227 | + getopts::optopt("", "test-shard", "run shard A, of B shards, worth of the testsuite", |
229 | 228 | "A.B")] |
230 | 229 | } |
231 | 230 |
|
232 | 231 | fn usage(binary: &str, helpstr: &str) { |
233 | 232 | let message = format!("Usage: {} [OPTIONS] [FILTER]", binary); |
234 | | - println!("{}", groups::usage(message, optgroups())); |
| 233 | + println!("{}", getopts::usage(message, optgroups())); |
235 | 234 | println!(""); |
236 | 235 | if helpstr == "help" { |
237 | 236 | println!("{}", "\ |
@@ -261,7 +260,7 @@ Test Attributes: |
261 | 260 | pub fn parse_opts(args: &[~str]) -> Option<OptRes> { |
262 | 261 | let args_ = args.tail(); |
263 | 262 | let matches = |
264 | | - match groups::getopts(args_, optgroups()) { |
| 263 | + match getopts::getopts(args_, optgroups()) { |
265 | 264 | Ok(m) => m, |
266 | 265 | Err(f) => return Some(Err(f.to_err_msg())) |
267 | 266 | }; |
|
0 commit comments