tests/kernel: Disable -Werror when testing deprecated pipe APIs

These two tests are validating that deprecated APIs still work
correctly. Which means they will definitely generate compile warnings.

To disable -Werror while letting it be enabled for other tests, create a
new Kconfig variable, DEPRECATION_TEST and make
COMPILER_WARNINGS_AS_ERRORS depend on that option being unselected. Add
this option to the two tests so that the resulting configuration
disables -Werror.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Keith Packard 2025-04-14 23:07:06 -07:00 committed by Anas Nashif
commit 3cdc5a9f9a
3 changed files with 11 additions and 0 deletions

View file

@ -542,9 +542,18 @@ config LTO
config COMPILER_WARNINGS_AS_ERRORS
bool "Treat warnings as errors"
depends on !DEPRECATION_TEST
help
Turn on "warning as error" toolchain flags
config DEPRECATION_TEST
bool "Indicate test for deprecated feature"
help
This option is selected by tests which check functionality of
deprecated features. It ensures that COMPILER_WARNINGS_AS_ERRORS
is not selected as that would generate errors when the deprecated
features are used.
config COMPILER_SAVE_TEMPS
bool "Save temporary object files"
help

View file

@ -3,3 +3,4 @@ CONFIG_TEST_USERSPACE=y
CONFIG_MP_MAX_NUM_CPUS=1
CONFIG_TIMESLICE_SIZE=0
CONFIG_PIPES=y
CONFIG_DEPRECATION_TEST=y

View file

@ -5,3 +5,4 @@ CONFIG_DYNAMIC_OBJECTS=y
CONFIG_MP_MAX_NUM_CPUS=1
CONFIG_ZTEST_FATAL_HOOK=y
CONFIG_PIPES=y
CONFIG_DEPRECATION_TEST=y