Skip to content

add some comments to clarify command-line argument munging in #482 #485

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
Oct 18, 2018
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: 7 additions & 0 deletions src/bin/cargo-miri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ fn main() {
);
match (test, &kind[..]) {
(true, "test") => {
// For test binaries we call `cargo rustc --test target -- <rustc args>`
if let Err(code) = process(
vec!["--test".to_string(), target.name].into_iter().chain(
args,
Expand All @@ -109,6 +110,11 @@ fn main() {
}
}
(true, "lib") => {
// For libraries we call `cargo rustc -- --test <rustc args>`
// Notice now that `--test` is a rustc arg rather than a cargo arg. This tells
// rustc to build a test harness which calls all #[test] functions. We don't
// use the harness since we execute each #[test] function's MIR ourselves before
// compilation even completes, but this option is necessary to build the library.
if let Err(code) = process(
vec!["--".to_string(), "--test".to_string()].into_iter().chain(
args,
Expand All @@ -119,6 +125,7 @@ fn main() {
}
}
(false, "bin") => {
// For ordinary binaries we call `cargo rustc --bin target -- <rustc args>`
if let Err(code) = process(
vec!["--bin".to_string(), target.name].into_iter().chain(
args,
Expand Down