Skip to content

Commit

Permalink
Added --target support. Fixes #309
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed Dec 3, 2022
1 parent 745b45b commit 028823b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,7 @@ All notable changes to insta and cargo-insta are documented here.
should make sure that ANSI sequences in strings are no longer screwing
up the terminal output. (#308)
- Prevent inline snapshots to be used in loops. (#307)
- Support the `--target` option to `cargo insta test`. (#309)

## 1.21.2

Expand Down
7 changes: 7 additions & 0 deletions cargo-insta/src/cli.rs
Expand Up @@ -149,6 +149,9 @@ pub struct TestCommand {
/// Do not activate the `default` feature
#[structopt(long)]
pub no_default_features: bool,
/// Build for the target triple
#[structopt(long)]
pub target: Option<String>,
/// Follow up with review.
#[structopt(long)]
pub review: bool,
Expand Down Expand Up @@ -825,6 +828,10 @@ fn prepare_test_runner<'snapshot_ref>(
if cmd.no_default_features {
proc.arg("--no-default-features");
}
if let Some(ref target) = cmd.target {
proc.arg("--target");
proc.arg(target);
}
proc.arg("--color");
proc.arg(color);
proc.args(extra_args);
Expand Down

0 comments on commit 028823b

Please sign in to comment.