Skip to content

test: ztest: audio: buffer: add the kernel include directory - #11498

Closed
lgirdwood wants to merge 1 commit into
thesofproject:mainfrom
lgirdwood:fix/ztest-buffer-kernel-include
Closed

lgirdwood wants to merge 1 commit into
thesofproject:mainfrom
lgirdwood:fix/ztest-buffer-kernel-include

Conversation

@lgirdwood

@lgirdwood lgirdwood commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

The sof.unit.audio.buffer ZTest does not build on main:

zephyr/lib/alloc.c:11:10: fatal error: 'sof/kernel/drivers/interrupt-map.h' file not found

The test was ported from CMocka in a1ab80b, after #11487 moved the kernel-only headers to src/kernel/include. It builds zephyr/lib/alloc.c and lists its include directories itself, so it needs src/kernel/include, like the other unit tests that build kernel sources.

Testing

On 9a990f5 (current main), run as in CI (twister on native_sim with ASan and LSan): all unit tests pass, including sof.unit.audio.buffer.

🤖 Generated with Claude Code

The buffer unit test builds zephyr/lib/alloc.c, which includes
<sof/kernel/drivers/interrupt-map.h> since commit 8b628c8 ("drivers:
move the sof/drivers headers to sof/kernel/drivers"). The test was
added after that and lists its include directories itself, so it does
not build. Add src/kernel/include, as for the other unit tests that
build kernel sources.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

@lgirdwood lgirdwood left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Code Review Summary

LGTM. test/ztest/unit/audio/buffer/CMakeLists.txt compiles zephyr/lib/alloc.c, which includes <sof/kernel/drivers/interrupt-map.h>, <sof/kernel/platform.h>, and <sof/kernel/lib/regions_mm.h> after #11487 merged concurrently with a1ab80bd1. Adding ${SOF_ROOT}/src/kernel/include matches the other ZTest suites that build kernel sources (audio/drc, math/fft, fast-get) and unblocks Zephyr Unit Tests (ZTest) CI on #11497.

@lgirdwood lgirdwood closed this Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants