From 01d0082e659a1a2cc72a42074f4403307fa2ede9 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Thu, 28 Nov 2024 22:57:01 -0500 Subject: [PATCH] Add support for --no-default-features flag in test command --- crates/tracel-xtask-macros/src/lib.rs | 7 +++++++ crates/tracel-xtask/src/commands/test.rs | 1 + crates/tracel-xtask/src/commands/validate.rs | 1 + 3 files changed, 9 insertions(+) diff --git a/crates/tracel-xtask-macros/src/lib.rs b/crates/tracel-xtask-macros/src/lib.rs index e266925..a321f28 100644 --- a/crates/tracel-xtask-macros/src/lib.rs +++ b/crates/tracel-xtask-macros/src/lib.rs @@ -267,6 +267,12 @@ fn get_additional_cmd_args_map() -> HashMap<&'static str, proc_macro2::TokenStre required = false )] pub features: Option>, + #[doc = r"If set, ignore default features."] + #[arg( + long = "no-default-features", + required = false + )] + pub no_default_features: bool, }, ), ( @@ -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" diff --git a/crates/tracel-xtask/src/commands/test.rs b/crates/tracel-xtask/src/commands/test.rs index 03b3a2a..9d78696 100644 --- a/crates/tracel-xtask/src/commands/test.rs +++ b/crates/tracel-xtask/src/commands/test.rs @@ -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, }) }), } diff --git a/crates/tracel-xtask/src/commands/validate.rs b/crates/tracel-xtask/src/commands/validate.rs index 79a1346..d4591bf 100644 --- a/crates/tracel-xtask/src/commands/validate.rs +++ b/crates/tracel-xtask/src/commands/validate.rs @@ -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(())