Tests should always deny warnings

This commit is contained in:
datdenkikniet 2023-04-16 13:30:23 +02:00
parent 0ee2d2c2db
commit e4b673646a
2 changed files with 8 additions and 12 deletions

View file

@ -94,11 +94,7 @@ impl Package {
pub struct TestMetadata {} pub struct TestMetadata {}
impl TestMetadata { impl TestMetadata {
pub fn match_package( pub fn match_package(package: Package, backend: Backends) -> CargoCommand<'static> {
deny_warnings: bool,
package: Package,
backend: Backends,
) -> CargoCommand<'static> {
match package { match package {
Package::Rtic => { Package::Rtic => {
let features = format!( let features = format!(
@ -111,38 +107,38 @@ impl TestMetadata {
package: Some(package.name()), package: Some(package.name()),
features, features,
test: Some("ui".to_owned()), test: Some("ui".to_owned()),
deny_warnings, deny_warnings: true,
} }
} }
Package::RticMacros => CargoCommand::Test { Package::RticMacros => CargoCommand::Test {
package: Some(package.name()), package: Some(package.name()),
features: Some(backend.to_rtic_macros_feature().to_owned()), features: Some(backend.to_rtic_macros_feature().to_owned()),
test: None, test: None,
deny_warnings, deny_warnings: true,
}, },
Package::RticSync => CargoCommand::Test { Package::RticSync => CargoCommand::Test {
package: Some(package.name()), package: Some(package.name()),
features: Some("testing".to_owned()), features: Some("testing".to_owned()),
test: None, test: None,
deny_warnings, deny_warnings: true,
}, },
Package::RticCommon => CargoCommand::Test { Package::RticCommon => CargoCommand::Test {
package: Some(package.name()), package: Some(package.name()),
features: Some("testing".to_owned()), features: Some("testing".to_owned()),
test: None, test: None,
deny_warnings, deny_warnings: true,
}, },
Package::RticMonotonics => CargoCommand::Test { Package::RticMonotonics => CargoCommand::Test {
package: Some(package.name()), package: Some(package.name()),
features: None, features: None,
test: None, test: None,
deny_warnings, deny_warnings: true,
}, },
Package::RticTime => CargoCommand::Test { Package::RticTime => CargoCommand::Test {
package: Some(package.name()), package: Some(package.name()),
features: Some("critical-section/std".into()), features: Some("critical-section/std".into()),
test: None, test: None,
deny_warnings, deny_warnings: true,
}, },
} }
} }

View file

@ -345,7 +345,7 @@ pub fn cargo_test<'c>(
package package
.packages() .packages()
.map(|p| { .map(|p| {
let meta = TestMetadata::match_package(globals.deny_warnings, p, backend); let meta = TestMetadata::match_package(p, backend);
(globals, meta, false) (globals, meta, false)
}) })
.run_and_coalesce() .run_and_coalesce()