From 3cdc5a9f9a9bcf690d2566094017f772922306e0 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 14 Apr 2025 23:07:06 -0700 Subject: [PATCH] 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 Signed-off-by: Anas Nashif --- Kconfig.zephyr | 9 +++++++++ tests/kernel/pipe/deprecated/pipe/prj.conf | 1 + tests/kernel/pipe/deprecated/pipe_api/prj.conf | 1 + 3 files changed, 11 insertions(+) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 99295612b68..070b4231eee 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -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 diff --git a/tests/kernel/pipe/deprecated/pipe/prj.conf b/tests/kernel/pipe/deprecated/pipe/prj.conf index 5b67871bd39..97ef605d171 100644 --- a/tests/kernel/pipe/deprecated/pipe/prj.conf +++ b/tests/kernel/pipe/deprecated/pipe/prj.conf @@ -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 diff --git a/tests/kernel/pipe/deprecated/pipe_api/prj.conf b/tests/kernel/pipe/deprecated/pipe_api/prj.conf index d080e2fbdbd..02d8fd3dd56 100644 --- a/tests/kernel/pipe/deprecated/pipe_api/prj.conf +++ b/tests/kernel/pipe/deprecated/pipe_api/prj.conf @@ -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