Skip to content

Add ./miri run-dep for running a file with test dependencies available #2890

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 5 commits into from
May 12, 2023

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented May 11, 2023

fixes #2443

config.program.args.push("--color".into());
config.program.args.push("always".into());
let mut cmd = ui_test::test_command(config, Path::new(&path))?;
cmd.arg("--");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who is this -- for? Separating cargo run arguments from arguments passed to the program?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, i'll add a comment

@@ -250,6 +266,19 @@ fn main() -> Result<()> {
Ok(())
}

fn run_dep_mode(target: String, mut args: impl Iterator<Item = OsString>) -> Result<()> {
let path = args.next().expect("./miri run-dep must be followed by a file name");
let mut config = test_config(&target, "", Mode::Yolo, true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let mut config = test_config(&target, "", Mode::Yolo, true);
let mut config = test_config(&target, "", Mode::Yolo, /* with_dependencies */ true);

@RalfJung
Copy link
Member

r=me with comments resolving the last 2 nits

@oli-obk
Copy link
Contributor Author

oli-obk commented May 12, 2023

@bors r=RalfJung

@bors
Copy link
Contributor

bors commented May 12, 2023

📌 Commit 2048c32 has been approved by RalfJung

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented May 12, 2023

⌛ Testing commit 2048c32 with merge 10c6d6a...

@bors
Copy link
Contributor

bors commented May 12, 2023

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing 10c6d6a to master...

@bors bors merged commit 10c6d6a into rust-lang:master May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide a way to run a test that needs an external dependency
4 participants