-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
unittest: add COMPILER_WARNINGS_AS_ERRORS handling #82928
unittest: add COMPILER_WARNINGS_AS_ERRORS handling #82928
Conversation
5b8cd7c
to
0dc50ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, thanks for this!
tests/bluetooth/audio/cap_commander/src/test_broadcast_reception.c
Outdated
Show resolved
Hide resolved
3d16071
to
0e3e782
Compare
subsys/bluetooth/host/hci_core.h
Outdated
#ifndef ZTEST_UNITTEST | ||
#include <zephyr/devicetree.h> | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it make more sense to have this #ifndef inside the devicetree.h
file itself, so that not everybody who wants to include it needs to know of this exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah not liking that either, but hey seems like that override was only needed on the linker file itself, I added a couple of undef for those at the end of the file and that seems to work, so that crappy hack is self contained at least.
Undefine the DT_NODE_HAS_STATUS and DT_NODE_HAS_STATUS_OKAY no nop at the end of the file so other uses can include devicetree.h without generating a compiler warning. Signed-off-by: Fabio Baltieri <[email protected]>
Fix various unit test build warnings, unused variables, set but unused variables, wrong types etc... Signed-off-by: Fabio Baltieri <[email protected]>
This flag is set on other compiler as well for normal builds, and suppresses a warning for empty print, which is apparently quite common. The unit test build uses its own flags so set it there as well to get the same behavior as with the rest of the code base. Signed-off-by: Fabio Baltieri <[email protected]>
Add a check to set the warnings_as_errors flags in unit tests if CONFIG_COMPILER_WARNINGS_AS_ERRORS is specified, this should catch warnings in unit test twister runs. Signed-off-by: Fabio Baltieri <[email protected]>
0e3e782
to
3e31c8a
Compare
Add a check to set the warnings_as_errors flags in unit tests if CONFIG_COMPILER_WARNINGS_AS_ERRORS is specified, this should catch warnings in unit test twister runs.