Skip to content

Commit fa62820

Browse files
test: drc: add ztest unit tests for drc module
Add native_sim Ztest coverage for two-channel DRC processing. Cover S16, S24, and S32 pass-through and enabled configurations through component creation, configuration, preparation, and processing. Add the minimal SOF allocator and context support required by the standalone test application while keeping existing CMocka tests and production sources unchanged. Signed-off-by: Piotr Hoppe <piotr.hoppe@intel.com>
1 parent b6142ca commit fa62820

6 files changed

Lines changed: 903 additions & 0 deletions

File tree

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
#
3+
# Copyright(c) 2026 Intel Corporation.
4+
5+
cmake_minimum_required(VERSION 3.20.0)
6+
7+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
8+
project(sof_unit_audio_drc)
9+
10+
set(SOF_ROOT "${PROJECT_SOURCE_DIR}/../../../../../")
11+
set(sof_top_dir ${SOF_ROOT})
12+
13+
# Include SOF CMake helpers used by trace source annotations.
14+
include(${SOF_ROOT}/scripts/cmake/misc.cmake)
15+
include(${SOF_ROOT}/scripts/cmake/uuid-registry.cmake)
16+
17+
target_include_directories(app PRIVATE
18+
${SOF_ROOT}/zephyr/include
19+
${SOF_ROOT}/src/include
20+
${SOF_ROOT}/src/platform/posix/include
21+
${SOF_ROOT}/src/audio
22+
${SOF_ROOT}/test/cmocka/include
23+
${PROJECT_BINARY_DIR}/include/generated
24+
)
25+
26+
target_compile_definitions(app PRIVATE
27+
-DCONFIG_ZEPHYR_POSIX=1
28+
-DCONFIG_LIBRARY=1
29+
-DCONFIG_NUMBERS_NORM=1
30+
-DUNIT_TEST=1
31+
)
32+
33+
target_compile_options(app PRIVATE
34+
-Wno-error=deprecated-declarations
35+
)
36+
37+
target_sources(app PRIVATE
38+
drc_process_ztest.c
39+
drc_test_alloc.c
40+
${SOF_ROOT}/src/audio/drc/drc.c
41+
${SOF_ROOT}/src/audio/drc/drc_generic.c
42+
${SOF_ROOT}/src/audio/drc/drc_math_generic.c
43+
${SOF_ROOT}/src/audio/drc/drc_math_hifi3.c
44+
${SOF_ROOT}/src/audio/drc/drc_log.c
45+
${SOF_ROOT}/src/math/numbers.c
46+
${SOF_ROOT}/src/math/exp_fcn.c
47+
${SOF_ROOT}/src/math/exp_fcn_hifi.c
48+
${SOF_ROOT}/src/math/lut_trig.c
49+
${SOF_ROOT}/src/audio/module_adapter/module_adapter.c
50+
${SOF_ROOT}/src/audio/module_adapter/module_adapter_ipc3.c
51+
${SOF_ROOT}/src/audio/module_adapter/module/generic.c
52+
${SOF_ROOT}/src/audio/buffers/comp_buffer.c
53+
${SOF_ROOT}/src/audio/buffers/audio_buffer.c
54+
${SOF_ROOT}/src/audio/source_api_helper.c
55+
${SOF_ROOT}/src/audio/sink_api_helper.c
56+
${SOF_ROOT}/src/audio/sink_source_utils.c
57+
${SOF_ROOT}/src/audio/audio_stream.c
58+
${SOF_ROOT}/src/audio/component.c
59+
${SOF_ROOT}/src/audio/data_blob.c
60+
${SOF_ROOT}/src/module/audio/source_api.c
61+
${SOF_ROOT}/src/module/audio/sink_api.c
62+
${SOF_ROOT}/src/ipc/ipc3/helper.c
63+
${SOF_ROOT}/src/ipc/ipc-common.c
64+
${SOF_ROOT}/src/ipc/ipc-helper.c
65+
${SOF_ROOT}/src/lib/objpool.c
66+
${SOF_ROOT}/src/audio/pipeline/pipeline-graph.c
67+
${SOF_ROOT}/src/audio/pipeline/pipeline-params.c
68+
${SOF_ROOT}/src/audio/pipeline/pipeline-schedule.c
69+
${SOF_ROOT}/src/audio/pipeline/pipeline-stream.c
70+
${SOF_ROOT}/src/audio/pipeline/pipeline-xrun.c
71+
)
72+
73+
sof_append_relative_path_definitions(app)

0 commit comments

Comments
 (0)