From 90bb3249069cca053e7fd177f191b3d06fc06527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Sun, 8 Jun 2025 18:18:01 +0200 Subject: xtask: Add --loom argument to test For now filter to only rtic-sync in ci subcommand --- xtask/src/argument_parsing.rs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'xtask/src/argument_parsing.rs') diff --git a/xtask/src/argument_parsing.rs b/xtask/src/argument_parsing.rs index 07c6330..ae73782 100644 --- a/xtask/src/argument_parsing.rs +++ b/xtask/src/argument_parsing.rs @@ -93,7 +93,7 @@ impl Package { pub struct TestMetadata {} impl TestMetadata { - pub fn match_package(package: Package, backend: Backends) -> CargoCommand<'static> { + pub fn match_package(package: Package, backend: Backends, loom: bool) -> CargoCommand<'static> { match package { Package::Rtic => { let features = Some(backend.to_target().and_features(backend.to_rtic_feature())); @@ -102,6 +102,7 @@ impl TestMetadata { features, test: Some("ui".to_owned()), deny_warnings: true, + loom, } } Package::RticMacros => CargoCommand::Test { @@ -109,30 +110,35 @@ impl TestMetadata { features: Some(backend.to_rtic_macros_feature().to_owned()), test: None, deny_warnings: true, + loom, }, Package::RticSync => CargoCommand::Test { package: Some(package.name()), features: Some("testing".to_owned()), test: None, deny_warnings: true, + loom, }, Package::RticCommon => CargoCommand::Test { package: Some(package.name()), features: Some("testing".to_owned()), test: None, deny_warnings: true, + loom, }, Package::RticMonotonics => CargoCommand::Test { package: Some(package.name()), features: None, test: None, deny_warnings: true, + loom, }, Package::RticTime => CargoCommand::Test { package: Some(package.name()), features: Some("critical-section/std".into()), test: None, deny_warnings: true, + loom, }, } } @@ -489,7 +495,7 @@ pub enum Commands { Doc(Arg), /// Run tests - Test(PackageOpt), + Test(TestOpt), /// Build books with mdbook Book(Arg), @@ -511,12 +517,21 @@ pub struct FormatOpt { } #[derive(Args, Debug, Clone, Default)] +pub struct TestOpt { + #[clap(flatten)] + pub package: PackageOpt, + /// Should tests be loom tests + #[clap(short, long)] + pub loom: bool, +} + +#[derive(Args, Debug, Clone, Copy, Default)] /// Restrict to package, or run on whole workspace pub struct PackageOpt { /// For which package/workspace member to operate /// /// If omitted, work on all - package: Option, + pub package: Option, } impl PackageOpt { -- cgit v1.2.3