Commit Graph

6 Commits

Author SHA1 Message Date
Grzegorz Swiderski
64bb8b6796 scripts: kconfig: Add hex variants of arithmetic functions
Functions like `add` and `sub` can only return base 10 integers, which
means they can't really be used to define Kconfig symbols of type `hex`.

For the same reason, there already exist pairs of devicetree functions
named e.g., `dt_node_reg_addr_(int|hex)` after different return types.

Introduce `add_hex`, `sub_hex`, and friends.

To avoid confusion, it should be possible for those new functions to
accept arguments in base 16 as well. It's actually easier to let all
arithmetic functions take their inputs in "any" base, by leveraging
Python's built-in: `int(..., base=0)`.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2025-06-17 16:09:41 +02:00
Pieter De Gendt
555a56f262 tests: kconfig: functions: Add min/max functions
Add test case for kconfig min/max functions.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-08-02 13:41:07 +02:00
Pieter De Gendt
1e6f39e91b tests: kconfig: functions: Fix arithmetic typo
Moved the test to a single main file, fixed a typo
arithmetric -> arithmetic

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-08-02 13:41:07 +02:00
TOKITA Hiroshi
e31588fcca tests: kconfig: Add tests for Kconfig arithmetrics
Add tests about kconfig function for arithmetric.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-07-31 12:56:25 +02:00
Carles Cufi
03a7dfbaa8 tests: Remove stray uses of CONFIG_ZTEST_NEW_API
Commit 345735d0a8 removed all uses of the
now obsolete CONFIG_ZTEST_NEW_API Kconfig option. A couple of stray ones
are still remaining in the tree, remove them.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-10-26 10:55:38 +02:00
Jordan Yates
cea39d4383 tests: kconfig: test configdefault extension
Test the behaviour of the `configdefault` kconfig extension.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-10-26 09:47:06 +02:00