Commit Graph

17 Commits

Author SHA1 Message Date
Alberto Escolar Piedras 41a92ec42e tests/misc/check_init_priorities: Don't test on native_posix
native_posix is now deprecated.
Building these tests in both native_sim and native_posix does not
improve coverage for the tests or subsystem but doubles CI time.
As anyhow native_posix will be removed all together in
2 releases, let's remove it already for these.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-09-25 04:04:36 -04:00
Alberto Escolar Piedras 4ea6cdf7db tests/misc/check_init_priorities: Fix integration_platforms list
Fix what seems like a silly mistake in the integration
platforms list.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-08-16 11:20:34 +01:00
Alberto Escolar Piedras 14cf0c5b71 tests check_init_priorities: Add missing overlays for native_sim
During the hwmv1->v2 transition, overlays from a base
board were made to be shared with the variants.
So at that time all overlays for variants which were
just copies of the base overlay were removed.
After that in
https://github.com/zephyrproject-rtos/zephyr/pull/71149
this shared/merged overlay behaviour was reverted,
but not all tests were fixed.

This is one of those. Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-18 12:20:14 +02:00
Alberto Escolar Piedras 9ccf2074e4 tests/misc/check_init_priorities: Use hwmv2 native targets ident
For the 64 bit targets, change identifiers to the new hwmv2 ones
And remove redundant overlays (which were equal for the 32
and 64 bit versions)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 690479fc36 tests/*: Switch integration platform to native_sim
Swith integration_platforms from native_posix(_64)
to native_sim(_64).

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-30 09:42:25 -05:00
Alberto Escolar Piedras 9aafc832a2 tests/misc/check_init_priorities: Fix for native_sim
Fix this test for the native_simulator,
and add it as a default test target.

Also be a bit clearer in stdout about the test having
passed or not.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-27 12:19:03 +00:00
Fabio Baltieri dd178ce311 scripts: check_init_priorities: rework the error messages
The current error messages are a bit cryptic, rework them to make them
more meaningful:

- add an extra message on the first error to explain what the errors
  refer to.
- rework the error message to be more explicit.
- rework the priority string print to use a LEVEL+offset format to
  somehow highlight that the number is the offset from the level, not
  the actual priority.
- print the init function name in addition to the devicetree path.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-03 11:45:23 +01:00
Fabio Baltieri 2a70c31945 scripts: check_init_priorities: drop the same priority check
Since bb590b5b6e introduced ordinals in the priority sequence, the "same
priority" case cannot happen anymore, furthermore the priority value in
the script is now the position of the function in the init sequence, so
if two devices have the same priority there's something real bad going
on.

Drop all the "same priority" handling code and tests, convert the case
into ane exception instead. Drop the init stubs as well from the test,
they are not required anymore.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-03 11:45:23 +01:00
Fabio Baltieri ecefcd7f87 misc: check_init_priorities: drop CONFIG_DEVICE_DEPS=y
This runs fine without CONFIG_DEVICE_DEPS, let's drop it from here.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-10-04 12:19:06 +01:00
Fabio Baltieri 5212a4c619 scripts: check_init_priorities: use the Zephyr executable file
Rework check_init_priorities to use the main executable file instead of
the individual object files for discovering the devices.

This should make the script more robust in case of stale files in the
build directory, and also makes it work with LTO object files.

Additionally, keep track of the detected init calls, and add a handy
"-i" option to produce a human readable print of the initcalls in the
call sequence, which can be useful for debugging initialization problems
due to odd SYS_INIT and DEVICE interactions.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-09-20 20:24:46 +01:00
Fabian Blatz 594e919b25 tests: misc: check_init_priorities: update output
Update the expected output of the init priority checking.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2023-09-05 10:05:50 +02:00
Fabio Baltieri 058f256ea1 Kconfig.zephyr: check priorities by default
Enable build time initialization priority check by default.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-24 15:35:37 +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
Jordan Yates f38e6aa0d1 tests: misc: check_init_priorities: update output
Update the expected output of the init priority checking.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-07-25 15:58:06 +00:00
Jordan Yates b65ac5b9e0 tests: misc: check_init_priorities: force two stage linking
Add `CONFIG_DEVICE_DEPS` to force two stage linking, otherwise the
following check means the test never runs:
```
if (TARGET zephyr_pre1)
  add_dependencies(zephyr_pre1 check_init_priorities_output)
endif()
```

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-07-25 15:58:06 +00:00
Gerard Marull-Paretas aedcc0b59d tests: misc: check_init_priorities: check for zephyr_pre1 target
zephyr_pre1 target may not always exists, e.g. if second linking pass is
not needed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-06-21 09:32:05 +02:00
Fabio Baltieri 2354cc9e25 test: misc: add a test application for check_init_priorities
Add a test specifically for the check_init_priorities scripts.

The test creates a set of fake devices to exercise the three possible
conditions, run a build, run the check script and validate the script
output.

The check is meant to fail the build on error but that's bypassed in
this case as that would fail the twister run. That specific bit is
covered in unit tests anyway.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-05-25 15:40:07 +02:00