提交 72f62abe 编写于 作者: B bors

auto merge of #9213 : dcrewi/rust/rust-test-arguments, r=catamorphism

The arguments after `rust test filename.rs` should be passed through
to the test binary. This allows the `rust` command to be used to run a
subset of tests, to run ignored tests, and to run benchmarks.
......@@ -84,7 +84,8 @@ struct Command<'self> {
usage_full: UsgStr(
"The test command is an shortcut for the command line \n\
\"rustc --test <filename> -o <filestem>test~ && \
./<filestem>test~\"\n\nUsage:\trust test <filename>"
./<filestem>test~ [<arguments>...]\"\
\n\nUsage:\trust test <filename> [<arguments>...]"
)
},
Command {
......@@ -155,12 +156,12 @@ fn print_usage(command_string: ~str) -> ValidUsage {
fn cmd_test(args: &[~str]) -> ValidUsage {
match args {
[ref filename] => {
[ref filename, ..prog_args] => {
let p = Path(*filename);
let test_exec = p.filestem().unwrap() + "test~";
invoke("rustc", &[~"--test", filename.to_owned(),
~"-o", test_exec.to_owned()], rustc::main_args);
let exit_code = run::process_status(~"./" + test_exec, []);
let exit_code = run::process_status(~"./" + test_exec, prog_args);
Valid(exit_code)
}
_ => Invalid
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册