Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Treat unit tests warnings as errors #312

Merged
merged 2 commits into from
Apr 5, 2023

Conversation

sboeuf
Copy link
Contributor

@sboeuf sboeuf commented Apr 5, 2023

Turn on the rustc flag -Dwarnings for all bazel rust tests so that all warnings would show up as errors.

Fixes #309

@sboeuf sboeuf requested a review from stillson April 5, 2023 10:28
@sboeuf
Copy link
Contributor Author

sboeuf commented Apr 5, 2023

/cc @rbradford I think this is fixing #309 :)

@sboeuf sboeuf requested a review from abrestic-rivos April 5, 2023 10:32
drivers/src/lib.rs Outdated Show resolved Hide resolved
@rbradford
Copy link
Contributor

/cc @rbradford I think this is fixing #309 :)

Although this is definitely an improvement - catching errors in the test build. I don't think it is the equivalent of cargo clippy --tests as this make clippy cover the test code?

@sboeuf
Copy link
Contributor Author

sboeuf commented Apr 5, 2023

/cc @rbradford I think this is fixing #309 :)

Although this is definitely an improvement - catching errors in the test build. I don't think it is the equivalent of cargo clippy --tests as this make clippy cover the test code?

Well I know this is different but this is eventually reaching the same goal of "not allowing warnings to be missed".

sboeuf added 2 commits April 5, 2023 15:09
Now that CpuInfo::parse_from() returns a Result, a warning was showing
up saying the result should be handled.

Signed-off-by: Sebastien Boeuf <[email protected]>
Turn on the rustc flag "-Dwarnings" for all bazel rust tests so that all
warnings would show up as errors.

Signed-off-by: Sebastien Boeuf <[email protected]>
@rbradford
Copy link
Contributor

/cc @rbradford I think this is fixing #309 :)

Although this is definitely an improvement - catching errors in the test build. I don't think it is the equivalent of cargo clippy --tests as this make clippy cover the test code?

Well I know this is different but this is eventually reaching the same goal of "not allowing warnings to be missed".

This is definitely an improvement but it doesn't solve #309 which is about clippy not covering the tests as clippy warns about things that rustc doesn't.

@dgreid dgreid merged commit 6c1ce9d into rivosinc:main Apr 5, 2023
@dgreid
Copy link
Collaborator

dgreid commented Apr 5, 2023

Thanks, I merged this, then reopened 309.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bazel build //:clippy-all doesn't check tests
3 participants