Commit graph

20 commits

Author SHA1 Message Date
Pieter De Gendt
638a696b7b tests: linker: iterable_sections: Test sorting with 5 numeric characters
Update the iterable numeric RAM/ROM tests to include a numeric value with
5 numeric characters.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-01-22 10:40:45 +01:00
Torsten Rasmussen
205691edce cmake: linker: evaluate CONFIG_LINKER_ITERABLE_SUBALIGN in CMake
Evaluate CONFIG_LINKER_ITERABLE_SUBALIGN in CMake instead of in the
linker script.

It cannot be assumed that a linker generator implementation is
pre-processed and therefore Kconfig settings cannot be used in those
but must be evaluated in CMake.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-09-25 16:16:35 -05:00
Pieter De Gendt
ff58bd0204 tests: misc: iterable_sections: Add CMake linker test case
Add a test with CONFIG_CMAKE_LINKER_GENERATOR enabled.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-05-13 10:41:47 +02:00
Pieter De Gendt
db8bb9ef56 cmake: linker: Use kconfig for iterable section subalign
Replace the hard-coded 4 with the Kconfig symbol
CONFIG_LINKER_ITERABLE_SECTION_SUBALIGN .

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-05-07 18:01:37 -04:00
Peter Mitsis
62db185d5b linker: tests: Use Z_LINK_ITERABLE_SUBALIGN
Updates the linker script fragments under 'tests' to use
Z_LINK_ITERABLE_SUBALIGN for the subalignment instead of
a hardcoded value of 4.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-04-20 13:45:25 -04:00
Peter Mitsis
48fdcfd992 tests: Update iterable sections test
Updates the test_ram/test_rom structures to use a 'long' instead
of an 'int' so that the structure sizes will be 4-bytes on 32-bit
platforms and 8-bytes on 64-bit platforms.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-04-20 13:45:25 -04:00
Christopher Friedt
28dccf236b tests: misc: iterable_sections: add named alternate tests
Add tests for the newly added
STRUCT_SECTION_ITERABLE_NAMED_ALTERNATE(). This type of
section should be iterated with
STRUCT_SECTION_FOREACH_ALTERNATE().

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-28 15:35:39 +01:00
Anas Nashif
345735d0a8 tests: remove CONFIG_ZTEST_NEW_API in all tests
Remove all usage of CONFIG_ZTEST_NEW_API from tests and sample as this
is now enabled by default.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-20 15:04:29 +02:00
Anas Nashif
79e2f22c6e tests: misc: fix identifiers
Do no use misc as component for test identifier.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-08-01 13:24:09 -04:00
Gerard Marull-Paretas
dacb3dbfeb iterable_sections: move to specific header
Until now iterable sections APIs have been part of the toolchain
(common) headers. They are not strictly related to a toolchain, they
just rely on linker providing support for sections. Most files relied on
indirect includes to access the API, now, it is included as needed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-22 10:42:30 +02:00
Gerard Marull-Paretas
b8efac92e0 linker: add ITERABLE_SECTION_RA|OM_NUMERIC
In some cases, like devices, it is necessary to sort numerically, that
is, sort 10 before 2. Add a new helper function to do that, up to 2
numeric digits.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-12 12:01:10 +02:00
Gerard Marull-Paretas
aae0fe8dab toolchain: add STRUCT_SECTION_ITERABLE_NAMED
Add a new API that allows to customize the name of an iterable section.
This allows to influence how section elements are sorted.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-12 12:01:10 +02:00
Kumar Gala
336803e96f tests: iterable_sections: Add missing zephyr_iterable_section
As the test is for iterable sections, we need to utilize
zephyr_iterable_section for targets that need linker script
generation like arm-clang.

So add zephyr_iterable_section() for the RAM & ROM sections
that the testcases utilizes.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2023-04-07 18:59:00 +02:00
Fabio Baltieri
29ac5d4381 tests: iterable_sections: stop excluding posix
The iterable_sections test is excluding posix. Whatever the issue was at
the time this was set, the test seems to run fine on native_posix just
fine now.

Dropping the exclude to make this test run on native_posix.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-03-14 16:23:24 -04:00
Chris Friedt
6841d96a59 tests: misc: iterable_sections: test alternate foreach
Add tests for `STRUCT_SECTION_FOREACH_ALTERNATE()`.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-03-06 13:52:29 +01:00
Martin Jäger
9973dc59cf tests: misc: iterable_sections: add const specifier for ROM data
Without the const specifier the data is stored in RAM instead of ROM.

Signed-off-by: Martin Jäger <martin@libre.solar>
2022-10-12 18:42:28 +02:00
Fabio Baltieri
def230187b test: fix more legacy #include paths
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-02 16:41:41 +01:00
Reto Schneider
7a6c5710ff cmake: Update cmake_minimum_required to 3.20.0
As Zephyr currently requires CMake version 3.20.0, update all
occurrences of cmake_minimum_required.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2022-07-04 10:18:45 +02:00
Chen Peng1
02ad698ce9 tests: iterable_sections: move to new ztest API.
Move test iterable_sections to use new ztest API.

Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
2022-06-29 15:50:14 -04:00
Fabio Baltieri
29585ee864 tests: iterable_sections: add a tests for iterable_sections
Add a test for iterable sections macro, covering read write and read
only sections.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2021-08-12 17:47:04 -04:00