Skip to content

Commit

Permalink
Add support for --no-default-features flag in test command
Browse files Browse the repository at this point in the history
  • Loading branch information
syl20bnr committed Nov 29, 2024
1 parent 6d95175 commit 01d0082
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/tracel-xtask-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@ fn get_additional_cmd_args_map() -> HashMap<&'static str, proc_macro2::TokenStre
required = false
)]
pub features: Option<Vec<String>>,
#[doc = r"If set, ignore default features."]
#[arg(
long = "no-default-features",
required = false
)]
pub no_default_features: bool,
},
),
(
Expand Down Expand Up @@ -487,6 +493,7 @@ fn generate_command_args_tryinto(args: TokenStream, input: TokenStream) -> Token
if ident_str != "target"
&& (ident_str == "exclude"
|| ident_str == "features"
|| ident_str == "no_default_features"
|| ident_str == "only"
|| ident_str == "ignore_audit"
|| ident_str == "jobs"
Expand Down
1 change: 1 addition & 0 deletions crates/tracel-xtask/src/commands/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub fn handle_command(args: TestCmdArgs) -> anyhow::Result<()> {
threads: args.threads,
jobs: args.jobs,
features: args.features.clone(),
no_default_features: args.no_default_features,
})
}),
}
Expand Down
1 change: 1 addition & 0 deletions crates/tracel-xtask/src/commands/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ pub fn handle_command(args: ValidateCmdArgs) -> anyhow::Result<()> {
jobs: None,
command: Some(TestSubCommand::All),
features: None,
no_default_features: false,
})?;

Ok(())
Expand Down

0 comments on commit 01d0082

Please sign in to comment.