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

devicetree: Fix Device tree tests cannot be built with coverage enabled #83673

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

Freey0
Copy link
Contributor

@Freey0 Freey0 commented Jan 8, 2025

Reopen #77208

To Peproduce:
./scripts/twister -p native_sim -T tests/lib/devicetree --coverage-tool gcovr -i --coverage

Logs:
INFO - Using Ninja..
INFO - Zephyr version: v3.7.0-1236-gad3e941ad3ed
INFO - Using 'zephyr' toolchain.
INFO - Building initial testsuite list...
INFO - Writing JSON report xxx/zephyr/twister-out/testplan.json
INFO - JOBS: 22
INFO - Adding tasks to the queue...
INFO - Added initial list of jobs to queue
ERROR - native_sim tests/lib/devicetree/api/libraries.devicetree.api ERROR : Build failure
INFO - xxx/zephyr/twister-out/native_sim/tests/lib/devicetree/api/libraries.devicetree.api/build.log
ERROR - Loading Zephyr default modules (Zephyr base).
/usr/bin/ld: xxx/zephyr/tests/lib/devicetree/api/src/main.c:1190: undefined reference to __device_dts_ord_86'
/usr/bin/ld: xxx/zephyr/tests/lib/devicetree/api/src/main.c:1197: undefined reference to `__device_dts_ord_87'
collect2: error: ld returned 1 exit status

Reason:
DT_SPEC related macro tests (ADC_DT_SPEC_GET_BY_NAME, MBOX_DT_SPEC_GET)should not appear in "api test" because the configuration does not turn on any devices

Move DP_SPEC-related tests to "api_ext test" and enable the related device in the configuration

fix #77205

DT_SPEC related macro tests (ADC_DT_SPEC_GET_BY_NAME, MBOX_DT_SPEC_GET)
should not appear in this test because the configuration does not turn
on any devices

Move DP_SPEC-related tests to api_ext and enable the related device in the
configuration

fix zephyrproject-rtos#77205

Signed-off-by: Wenbin Zhang <[email protected]>
struct adc_dt_spec adc_spec;

/* ADC_DT_SPEC_GET_BY_NAME */
adc_spec = (struct adc_dt_spec)ADC_DT_SPEC_GET_BY_NAME(TEST_TEMP, ch1);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These DT_SPEC-related macros require device definitions

@Freey0
Copy link
Contributor Author

Freey0 commented Jan 18, 2025

@vcgomes A friendly ping

@Freey0
Copy link
Contributor Author

Freey0 commented Jan 22, 2025

A friendly ping @vcgomes @holtmann

@kartben kartben merged commit 7d4e31a into zephyrproject-rtos:main Jan 22, 2025
22 checks passed
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.

Device tree tests cannot be built with coverage enabled
5 participants