Commit Graph

13 Commits

Author SHA1 Message Date
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