Skip to content

Commit 8df61aa

Browse files
committed
improve compiletest error message when path option missing.
(I often run `compiletest` by hand by cut-and-pasting from what `make` runs, but then I need to tweak it (cut out options) and its useful to be told when I have removed an option that is actually required, such as `--android-cross-path=path`.)
1 parent f186759 commit 8df61aa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/compiletest/compiletest.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ pub fn parse_config(args: Vec<String> ) -> Config {
111111
}
112112

113113
fn opt_path(m: &getopts::Matches, nm: &str) -> Path {
114-
Path::new(m.opt_str(nm).unwrap())
114+
match m.opt_str(nm) {
115+
Some(s) => Path::new(s),
116+
None => panic!("no option (=path) found for {}", nm),
117+
}
115118
}
116119

117120
let filter = if !matches.free.is_empty() {

0 commit comments

Comments
 (0)