xtask: rtic-sync

This commit is contained in:
Henrik Tjäder 2023-03-02 19:40:50 +01:00
parent 32b537aef6
commit 39a06368c8
2 changed files with 5 additions and 21 deletions

View file

@ -5,11 +5,10 @@ use core::fmt;
#[derive(clap::ValueEnum, Copy, Clone, Debug)]
pub enum Package {
Rtic,
RticArbiter,
RticChannel,
RticCommon,
RticMacros,
RticMonotonics,
RticSync,
RticTime,
}
@ -23,11 +22,10 @@ impl Package {
pub fn name(&self) -> &str {
match self {
Package::Rtic => "rtic",
Package::RticArbiter => "rtic-arbiter",
Package::RticChannel => "rtic-channel",
Package::RticCommon => "rtic-common",
Package::RticMacros => "rtic-macros",
Package::RticMonotonics => "rtic-monotonics",
Package::RticSync => "rtic-sync",
Package::RticTime => "rtic-time",
}
}
@ -55,12 +53,7 @@ impl TestMetadata {
features: Some(backend.to_rtic_macros_feature().to_owned()),
test: None,
},
Package::RticArbiter => CargoCommand::Test {
package: Some(package),
features: Some("testing".to_owned()),
test: None,
},
Package::RticChannel => CargoCommand::Test {
Package::RticSync => CargoCommand::Test {
package: Some(package),
features: Some("testing".to_owned()),
test: None,

View file

@ -129,25 +129,16 @@ pub fn cargo_doc(cargoarg: &Option<&str>, backend: Backends) -> anyhow::Result<(
/// If no package is specified, loop through all packages
pub fn cargo_test(package: &PackageOpt, backend: Backends) -> anyhow::Result<()> {
if let Some(package) = package.package {
let cmd = match package {
Package::Rtic => TestMetadata::match_package(package, backend),
Package::RticArbiter => TestMetadata::match_package(package, backend),
Package::RticChannel => TestMetadata::match_package(package, backend),
Package::RticCommon => TestMetadata::match_package(package, backend),
Package::RticMacros => TestMetadata::match_package(package, backend),
Package::RticMonotonics => TestMetadata::match_package(package, backend),
Package::RticTime => TestMetadata::match_package(package, backend),
};
let cmd = TestMetadata::match_package(package, backend);
command_parser(&cmd, false)?;
} else {
// Iterate over all workspace packages
for package in [
Package::Rtic,
Package::RticArbiter,
Package::RticChannel,
Package::RticCommon,
Package::RticMacros,
Package::RticMonotonics,
Package::RticSync,
Package::RticTime,
] {
let mut error_messages = vec![];