Skip to content

rust test: pass the remaining arguments through #9213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 15, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/librust/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ static COMMANDS: &'static [Command<'static>] = &'static [
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 {
Expand Down Expand Up @@ -155,12 +156,12 @@ fn cmd_help(args: &[~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
Expand Down