From 72e037d85f4d1dde1da156f59c3891e9f963ea15 Mon Sep 17 00:00:00 2001 From: Jonathan Keller Date: Tue, 10 Sep 2024 10:05:05 -0700 Subject: [PATCH] [tests] Fail on invalid cfg(feature) directives The current implementation does not generate valid feature flags for derived peripherals, but this was not caught by the tests because rustc only emits a warning rather than an error. --- tests/common/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/common/mod.rs b/tests/common/mod.rs index a8e7b6b..af1c2ef 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -30,6 +30,8 @@ pub fn assert_cargo_build(package_folder: tempfile::TempDir) { let mut command = Command::new("cargo"); command.arg("build"); command.current_dir(package_folder.path()); + // Error on invalid cfg(feature) directives + command.env("RUSTFLAGS", "-D unexpected_cfgs"); let exec_result = command.output();