Skip to content

Commit 3b2155e

Browse files
keith-packardnashif
authored andcommitted
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 <[email protected]>
1 parent a364c2f commit 3b2155e

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

Kconfig.zephyr

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,9 +542,18 @@ config LTO
542542

543543
config COMPILER_WARNINGS_AS_ERRORS
544544
bool "Treat warnings as errors"
545+
depends on !DEPRECATION_TEST
545546
help
546547
Turn on "warning as error" toolchain flags
547548

549+
config DEPRECATION_TEST
550+
bool "Indicate test for deprecated feature"
551+
help
552+
This option is selected by tests which check functionality of
553+
deprecated features. It ensures that COMPILER_WARNINGS_AS_ERRORS
554+
is not selected as that would generate errors when the deprecated
555+
features are used.
556+
548557
config COMPILER_SAVE_TEMPS
549558
bool "Save temporary object files"
550559
help

tests/kernel/pipe/deprecated/pipe/prj.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ CONFIG_ZTEST=y
22
CONFIG_TEST_USERSPACE=y
33
CONFIG_MP_MAX_NUM_CPUS=1
44
CONFIG_PIPES=y
5+
CONFIG_DEPRECATION_TEST=y

tests/kernel/pipe/deprecated/pipe_api/prj.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ CONFIG_DYNAMIC_OBJECTS=y
55
CONFIG_MP_MAX_NUM_CPUS=1
66
CONFIG_ZTEST_FATAL_HOOK=y
77
CONFIG_PIPES=y
8+
CONFIG_DEPRECATION_TEST=y

0 commit comments

Comments
 (0)