Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions test/ztest/unit/math/basic/trigonometry/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(test_math_trigonometry)

set(SOF_ROOT "${PROJECT_SOURCE_DIR}/../../../../../..")

target_include_directories(app PRIVATE
${SOF_ROOT}/zephyr/include
${SOF_ROOT}/src/include
)

# Define SOF-specific configurations for unit testing
target_compile_definitions(app PRIVATE
-DCONFIG_SOF_LOG_LEVEL=CONFIG_LOG_DEFAULT_LEVEL
-DCONFIG_ZEPHYR_POSIX=1
-DCONFIG_LIBRARY=1
-DUNIT_TEST=1
)

target_sources(app PRIVATE
trig_test.c
${SOF_ROOT}/src/math/trig.c
${SOF_ROOT}/src/math/lut_trig.c
)

# Link math library for standard math functions
target_link_libraries(app PRIVATE m)
1 change: 1 addition & 0 deletions test/ztest/unit/math/basic/trigonometry/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_ZTEST=y
24 changes: 24 additions & 0 deletions test/ztest/unit/math/basic/trigonometry/testcase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SPDX-License-Identifier: BSD-3-Clause
#
# Copyright(c) 2025 Intel Corporation. All rights reserved.
#
# Math basic trigonometry unit tests converted from CMock to Ztest
#
# These contents may have been developed with support from one or more Intel-operated
# generative artificial intelligence solutions.
#

common:
tags:
- SOF
- unit_test
- math
- trigonometry
integration_platforms:
- native_sim
arch_exclude: xtensa # Test is for host builds only

tests:
sof.unit.math.trigonometry:
platform_allow:
- native_sim
Loading
Loading