Skip to content

Commit

Permalink
[tests] Fail on invalid cfg(feature) directives
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jnkr-ifx committed Sep 10, 2024
1 parent a89f625 commit 72e037d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

1 comment on commit 72e037d

@pellico
Copy link
Contributor

@pellico pellico commented on 72e037d Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am aware of this issue due to latest Rust compiler. Unfortunately this break Aurix test. Aurix test are executed with Hightec Aurix compiler that is not available in GitHub. We run this test at IFX in our automation.
I am thinking to fix the warning later in more elegant way together with issue #28 . We can discuss it in our phone call.

Please sign in to comment.