Skip to content

Commit

Permalink
test: Only run clippy lint test with -Dwarnings
Browse files Browse the repository at this point in the history
Currently, every cargo invocation in the integration tests runs with
-Dwarnings. This is fairly annoying, because it causes all tests to fail
if there is a single compilation warning emitted somewhere. When locally
testing some changes, this means that code needs to be cleaned up to fix
all warnings before any test can be run, which makes rapid prototyping
very slow.

This commit changes our testing to only pass -Dwarnings to our clippy
lint test. This way we still block CI on compiler warnings, but no
longer prevent literally every test from running if a single warning is
emitted anywhere.

Signed-off-by: Patrick Roy <[email protected]>
  • Loading branch information
roypat committed Sep 13, 2023
1 parent dc9f432 commit 09ae793
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
14 changes: 7 additions & 7 deletions .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
target-dir = "build/cargo_target"
target = "x86_64-unknown-linux-musl"
rustflags = [
"-Dclippy::ptr_as_ptr",
"-Dclippy::undocumented_unsafe_blocks",
"-Dclippy::cast_lossless",
"-Dclippy::cast_possible_wrap",
"-Dclippy::cast_sign_loss",
"-Dmissing_debug_implementations",
"-Dclippy::exit",
"-Wclippy::ptr_as_ptr",
"-Wclippy::undocumented_unsafe_blocks",
"-Wclippy::cast_lossless",
"-Wclippy::cast_possible_wrap",
"-Wclippy::cast_sign_loss",
"-Wmissing_debug_implementations",
"-Wclippy::exit",
]

[net]
Expand Down
5 changes: 2 additions & 3 deletions tests/host_tools/cargo_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ def cargo(

def get_rustflags():
"""Get the relevant rustflags for building/unit testing."""
rustflags = "-D warnings"
if platform.machine() == "aarch64":
rustflags += " -C link-arg=-lgcc -C link-arg=-lfdt "
return rustflags
return "-C link-arg=-lgcc -C link-arg=-lfdt "
return ""


@with_filelock
Expand Down

0 comments on commit 09ae793

Please sign in to comment.