From e868d35b0da78389a580edbb5cd7f343f15f5132 Mon Sep 17 00:00:00 2001 From: maciektr Date: Fri, 10 May 2024 14:43:39 +0200 Subject: [PATCH] Add skip build option to cairo-test commit-id:c14819d8 --- extensions/scarb-cairo-test/src/main.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/extensions/scarb-cairo-test/src/main.rs b/extensions/scarb-cairo-test/src/main.rs index 8d460f818..e702cbfff 100644 --- a/extensions/scarb-cairo-test/src/main.rs +++ b/extensions/scarb-cairo-test/src/main.rs @@ -32,6 +32,10 @@ struct Args { /// Whether to print resource usage after each test. #[arg(long, default_value_t = false)] print_resource_usage: bool, + + /// Do not rebuild the package. + #[arg(long, default_value_t = false)] + no_build: bool, } fn main() -> Result<()> { @@ -42,13 +46,15 @@ fn main() -> Result<()> { check_scarb_version(&metadata); let matched = args.packages_filter.match_many(&metadata)?; - let filter = PackagesFilter::generate_for::(matched.iter()); - ScarbCommand::new() - .arg("build") - .arg("--test") - .env("SCARB_PACKAGES_FILTER", filter.to_env()) - .run()?; + if !args.no_build { + let filter = PackagesFilter::generate_for::(matched.iter()); + ScarbCommand::new() + .arg("build") + .arg("--test") + .env("SCARB_PACKAGES_FILTER", filter.to_env()) + .run()?; + } let profile = env::var("SCARB_PROFILE").unwrap_or("dev".into()); let default_target_dir = metadata.runtime_manifest.join("target");