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
3 changes: 0 additions & 3 deletions .github/workflows/daily-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,5 @@ jobs:
user-space-other-tools:
uses: ./.github/workflows/tools.yml

cmocka-unit-tests:
uses: ./.github/workflows/unit-tests.yml

zephyr-builds:
uses: ./.github/workflows/zephyr.yml
30 changes: 0 additions & 30 deletions .github/workflows/unit-tests.yml

This file was deleted.

2 changes: 1 addition & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The SOF firmware is built with a modular, layered architecture to support multip

### 2.1 OS Abstraction and RTOS
* **Zephyr RTOS:** Modern SOF extensively leverages the Zephyr RTOS for core operating system services, including thread scheduling, synchronization, logging, and hardware abstraction.
* **Host builds:** The host library, testbench and unit tests run on the host, with POSIX replacements for the RTOS headers (`posix/include`).
* **Host builds:** The host library and testbench run on the host, with POSIX replacements for the RTOS headers (`posix/include`).

### 2.2 Inter-Process Communication (IPC)
The IPC subsystem is responsible for all communication between the Host OS and the DSP Firmware.
Expand Down
17 changes: 2 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,12 @@ endif()
find_package(Python3 COMPONENTS Interpreter)
set(PYTHON3 "${Python3_EXECUTABLE}")

option(BUILD_UNIT_TESTS "Build unit tests" OFF)
option(BUILD_UNIT_TESTS_HOST "Build unit tests for host" OFF)
option(BUILD_COUNTERS "Enable build counter(s), timestamps and any other
non-deterministic build features" OFF)

if(BUILD_UNIT_TESTS AND NOT BUILD_UNIT_TESTS_HOST)
message(FATAL_ERROR "Unit tests can only be built for the host, "
"use -DBUILD_UNIT_TESTS_HOST=ON")
endif()

# The firmware is built with Zephyr (scripts/xtensa-build-zephyr.py), this
# top-level project only builds the host library and the unit tests.
if(NOT (CONFIG_LIBRARY OR BUILD_UNIT_TESTS_HOST OR CONFIG_ZEPHYR_POSIX))
# top-level project only builds the host library.
if(NOT (CONFIG_LIBRARY OR CONFIG_ZEPHYR_POSIX))
message(FATAL_ERROR "The XTOS firmware build has been removed, "
"use scripts/xtensa-build-zephyr.py to build the firmware")
endif()
Expand Down Expand Up @@ -144,9 +137,3 @@ if(CONFIG_LIBRARY)
# rest of this file is not needed for host build
return()
endif()

if(BUILD_UNIT_TESTS)
enable_testing()
add_subdirectory(src/kernel/arch/${ARCH})
add_subdirectory(test)
endif()
1 change: 0 additions & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ zephyr/lib/regions_mm.c @dabekjakub
# dumb list of source files and generate too much noise.
# /CMakeLists.txt TODO
#/*/CMakeLists.txt TODO
# /test/cmocka/CMakeLists.txt TODO

# There's a small enough number of files in tools/ and little
# churn: keep it simple and take them all.
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ The script will guide you through the process of installing system dependencies,

## Running the tests

See [unit testing documentation](https://thesofproject.github.io/latest/developer_guides/unit_tests.html)
The unit tests are Zephyr ztest suites in `test/ztest/unit`, run on
`native_sim`. From the west workspace, as in CI
(`.github/workflows/zephyr-unit-tests.yml`):

```
west twister --testsuite-root sof/test/ztest/unit/ --platform native_sim --enable-asan --enable-lsan
```

See also the [unit testing documentation](https://thesofproject.github.io/latest/developer_guides/unit_tests.html).

## Deployment

Expand Down
3 changes: 1 addition & 2 deletions scripts/cmake/git-submodules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ if(GIT_FOUND AND EXISTS "${SOF_ROOT_SOURCE_DIRECTORY}/.git")
"There are submodule changes, check git status and git diff\n${stdout}")
endif()

elseif(NOT BUILD_UNIT_TESTS AND
NOT CONFIG_LIBRARY)
elseif(NOT CONFIG_LIBRARY)

message(FATAL_ERROR
"${TOMLC99_MAKE} not found. You should have used 'git clone --recursive'. \
Expand Down
5 changes: 1 addition & 4 deletions scripts/cmake/kconfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@ set(INIT_CONFIG "initial.config" CACHE STRING "Initial .config file")
# - ".' is the top source directory.
# - "src/kernel/arch/host/configs" holds the library (testbench) configurations
# and is also used by defconfigs.cmake.
# - "test/cmocka/configs" holds the unit test configurations.
# - First found wins.
# - If two directories ever use the same defconfig name then a full
# path must be used, e.g.: -DINIT_CONFIG=test/cmocka/configs/collision_defconfig

set(init_config_search_list "." "src/kernel/arch/host/configs" "test/cmocka/configs")
set(init_config_search_list "." "src/kernel/arch/host/configs")

find_file(INIT_CONFIG_found
NAMES ${INIT_CONFIG}
Expand Down
84 changes: 0 additions & 84 deletions scripts/run-mocks.sh

This file was deleted.

3 changes: 1 addition & 2 deletions src/audio/eq_iir/tune/sof_cmocka_data_eq_fir.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ function sof_cmocka_data_eq_fir()
sof_eq_paths(true);

% Output files and paths
sof_cmocka = '../../../../test/cmocka';
sof_ztest = '../../../../test/ztest/unit/audio';

chirp_fn = fullfile(sof_cmocka, 'include/cmocka_chirp_2ch.h');
chirp_fn = '../../../../test/ztest/unit/include/cmocka_chirp_2ch.h';
ref_fn = fullfile(sof_ztest, 'eq_fir/cmocka_fir_ref.h');
coef_fn = fullfile(sof_ztest, 'eq_fir/cmocka_fir_coef_2ch.h');

Expand Down
3 changes: 1 addition & 2 deletions src/audio/eq_iir/tune/sof_cmocka_data_eq_iir.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ function sof_cmocka_data_eq_iir()
sof_eq_paths(true);

% Output files and paths
sof_cmocka = '../../../../test/cmocka';
sof_ztest = '../../../../test/ztest/unit/audio';
chirp_fn = fullfile(sof_cmocka, 'include/cmocka_chirp_2ch.h');
chirp_fn = '../../../../test/ztest/unit/include/cmocka_chirp_2ch.h';
ref_fn = fullfile(sof_ztest, 'eq_iir/cmocka_chirp_iir_ref_2ch.h');
coef_fn = fullfile(sof_ztest, 'eq_iir/cmocka_iir_coef_2ch.h');

Expand Down
2 changes: 1 addition & 1 deletion src/include/sof/lib/fast-get.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct mod_alloc_ctx;
* SDK (CONFIG_LLEXT_TYPE_ELF_RELOCATABLE=n while
* CONFIG_LLEXT_TYPE_ELF_SHAREDLIB=y).
* For unit-testing full versions of fast_get() and fast_put() are checked by
* test/ztest/unit/fast-get/ and test/cmocka/src/lib/fast-get/
* test/ztest/unit/fast-get/
*/
#if (CONFIG_COLD_STORE_EXECUTE_DRAM && \
(CONFIG_LLEXT_TYPE_ELF_RELOCATABLE || !defined(LL_EXTENSION_BUILD))) || \
Expand Down
4 changes: 1 addition & 3 deletions src/kernel/arch/host/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,4 @@ target_compile_options(sof_options INTERFACE -g -O3 -fPIC -DPIC -std=c99 -std=gn
-Wno-int-to-pointer-cast -Wpointer-arith
-DCONFIG_LIBRARY "-imacros${CONFIG_H_PATH}")

if(NOT BUILD_UNIT_TESTS_HOST)
add_subdirectory(lib)
endif()
add_subdirectory(lib)
2 changes: 1 addition & 1 deletion src/kernel/platform/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ config ESP32P4_PIE_SIMD
128-bit vector SIMD engine for audio processing kernels (volume, mixer, etc.).

#
# For non-Zephyr builds like testbench and cmocka,
# For non-Zephyr builds like the testbench,
# set core count separately.
#
if !ZEPHYR_SOF_MODULE
Expand Down
3 changes: 0 additions & 3 deletions test/CMakeLists.txt

This file was deleted.

103 changes: 0 additions & 103 deletions test/cmocka/CMakeLists.txt

This file was deleted.

Loading
Loading