Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: drivers: build_all: can: Add spi-devices build test #78602

Closed

Conversation

soburi
Copy link
Member

@soburi soburi commented Sep 17, 2024

Add build tests for following devices.

  • microchip,mcp2515
  • microchip,mcp251xfd
  • ti,tcan4x5x

Add build tests for following devices.

- microchip,mcp2515
- microchip,mcp251xfd
- ti,tcan4x5x

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Comment on lines +28 to +29
drivers.can.build_all.spi:
extra_args: DTC_OVERLAY_FILE="spi_devices.overlay"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are already tested by the test cases defined just above this one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference between these two is the presence or absence of spi_devices.overlay, as you quoted part.

In the test above, only boards/native_sim.overlay is referenced, but since there is no device definition in this, no driver is built.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean. The SPI peripherals, you've added to the overlay, are tested in the test cases above using shields.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ west twister -v -T tests/drivers/build_all/can/
Renaming output directory to /home/brix/Projects/zephyrproject/zephyr/twister-out.20
INFO    - Using Ninja..
INFO    - Zephyr version: v3.7.0-3021-g74c5c84c66d5
INFO    - Using 'zephyr' toolchain.
INFO    - Selecting default platforms per test case
INFO    - Building initial testsuite list...
INFO    - Writing JSON report /home/brix/Projects/zephyrproject/zephyr/twister-out/testplan.json
INFO    - JOBS: 4
INFO    - Adding tasks to the queue...
INFO    - Added initial list of jobs to queue
INFO    - 1/5 native_posix/native/64    tests/drivers/build_all/can/drivers.can.build_all.native_linux PASSED (build)
INFO    - 2/5 native_sim/native/64      tests/drivers/build_all/can/drivers.can.build_all.native_linux PASSED (build)
INFO    - 3/5 lpcxpresso55s28           tests/drivers/build_all/can/drivers.can.build_all.mcp251xfd PASSED (build)
INFO    - 4/5 frdm_k64f                 tests/drivers/build_all/can/drivers.can.build_all.tcan4x5x PASSED (build)
INFO    - 5/5 frdm_k64f                 tests/drivers/build_all/can/drivers.can.build_all.mcp2515 PASSED (build)

INFO    - 4 test scenarios (5 test instances) selected, 0 configurations skipped (0 by static filter, 0 at runtime).
INFO    - 5 of 5 test configurations passed (100.00%), 0 failed, 0 errored, 0 skipped with 0 warnings in 14.63 seconds
INFO    - In total 0 test cases were executed, 5 skipped on 4 out of total 842 platforms (0.48%)
INFO    - 0 test configurations executed on platforms, 5 test configurations were only built.
INFO    - Saving reports...
INFO    - Writing JSON report /home/brix/Projects/zephyrproject/zephyr/twister-out/twister.json
INFO    - Writing xunit report /home/brix/Projects/zephyrproject/zephyr/twister-out/twister.xml...
INFO    - Writing xunit report /home/brix/Projects/zephyrproject/zephyr/twister-out/twister_report.xml...
INFO    - Run completed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for explaing.
I understood what you mean.

My intention is to build all i2c and spi drivers comprehensively with native_sim, as is done with tests/drivers/build_all/sensor and some other build_all tests.

As you pointed out, there is certainly some overlap, but I think there is an advantage to putting a comprehensive build check for native_sim here, because it allows you to compile various devices that are not dependent on a specific SoC with west twister -p native_sim -T tests/drivers/build_all, and the overlaps parts are also work as checks for portability for diffferent environment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding native_sim build-only tests for these driver duplicate the existing efforts, and will duplicate the time spent by CI checking these. There are no requirements that build_all uses native_sim.

The existing build_all tests have the benefit of also doing a build test of the various shield definitions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got it, thank you for joining the discussion.

@soburi soburi closed this Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants