From 2e63f5bca30acdec81495e0dc59aa6f7ebff5976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Sat, 4 Mar 2023 02:11:50 +0100 Subject: [PATCH] ci: Add rtic-uitest feature Fixes the trybuild ui tests for rtic crate --- rtic/Cargo.toml | 1 + rtic/src/export.rs | 10 +++++++--- xtask/src/argument_parsing.rs | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/rtic/Cargo.toml b/rtic/Cargo.toml index e73b970de9..ccda992e6c 100644 --- a/rtic/Cargo.toml +++ b/rtic/Cargo.toml @@ -74,6 +74,7 @@ thumbv8main-backend = ["rtic-macros/cortex-m-basepri"] # riscv-esp32c3-backend = ["rtic-macros/riscv-esp32c3"] # needed for testing +rtic-uitest = ["thumbv7-backend","rtic-macros/cortex-m-basepri"] test-critical-section = ["cortex-m/critical-section-single-core", "rtic-monotonics/systick-100hz"] # [[example]] diff --git a/rtic/src/export.rs b/rtic/src/export.rs index 6fc97add3e..86e9c3a875 100644 --- a/rtic/src/export.rs +++ b/rtic/src/export.rs @@ -20,10 +20,10 @@ compile_error!( "Building for Cortex-M with source masking, but 'thumbv6-backend' or 'thumbv8base-backend' backend not selected" ); -#[cfg(any(feature = "cortex-m-basepri"))] +#[cfg(any(feature = "cortex-m-basepri", feature = "rtic-uitest"))] pub use cortex_basepri::*; -#[cfg(any(feature = "cortex-m-basepri"))] +#[cfg(any(feature = "cortex-m-basepri", feature = "rtic-uitest"))] mod cortex_basepri; #[cfg(feature = "cortex-m-source-masking")] @@ -33,7 +33,11 @@ pub use cortex_source_mask::*; mod cortex_source_mask; /// Priority conversion, takes logical priorities 1..=N and converts it to NVIC priority. -#[cfg(any(feature = "cortex-m-basepri", feature = "cortex-m-source-masking",))] +#[cfg(any( + feature = "cortex-m-basepri", + feature = "cortex-m-source-masking", + feature = "rtic-uitest", +))] #[inline] #[must_use] pub const fn cortex_logical2hw(logical: u8, nvic_prio_bits: u8) -> u8 { diff --git a/xtask/src/argument_parsing.rs b/xtask/src/argument_parsing.rs index 1fc06c1f8b..aef5e3ab59 100644 --- a/xtask/src/argument_parsing.rs +++ b/xtask/src/argument_parsing.rs @@ -38,9 +38,10 @@ impl TestMetadata { match package { Package::Rtic => { let features = Some(format!( - "{},{}", + "{},{},{}", DEFAULT_FEATURES, backend.to_rtic_feature(), + "rtic-uitest" )); CargoCommand::Test { package: Some(package),