diff --git a/.gitignore b/.gitignore index 04236a82..833049a0 100644 --- a/.gitignore +++ b/.gitignore @@ -40,7 +40,6 @@ examples/AN00218_app_hires_DAS_fixed/doc/pdf/AN00218.pdf **/*.local.* **/*.local.*/ - # Unit test runners **/runners/* @@ -49,3 +48,6 @@ examples/AN00218_app_hires_DAS_fixed/doc/pdf/AN00218.pdf .waf-*/ build/ build.xcore + +# Python cache information +lib_mic_array.egg-info diff --git a/tests/test_deps.cmake b/tests/test_deps.cmake deleted file mode 100644 index b30075b9..00000000 --- a/tests/test_deps.cmake +++ /dev/null @@ -1,31 +0,0 @@ -# Common dependencies for test - -if(NOT EXISTS ${XMOS_SANDBOX_DIR}/Unity) - include(FetchContent) - message(STATUS "Fetching Unity") - FetchContent_Declare( - Unity - GIT_REPOSITORY https://github.com/ThrowTheSwitch/Unity.git - GIT_TAG v2.5.2 - GIT_SHALLOW TRUE - DOWNLOAD_ONLY TRUE - SOURCE_DIR ${XMOS_SANDBOX_DIR}/Unity - ) - FetchContent_Populate(Unity) -endif() - -set(UNITY_C_SRCS ${XMOS_SANDBOX_DIR}/Unity/src/unity.c - ${XMOS_SANDBOX_DIR}/Unity/extras/fixture/src/unity_fixture.c - ${XMOS_SANDBOX_DIR}/Unity/extras/memory/src/unity_memory.c -) - -set(UNITY_INCLUDES ${XMOS_SANDBOX_DIR}/Unity/src - ${XMOS_SANDBOX_DIR}/Unity/extras/fixture/src/ - ${XMOS_SANDBOX_DIR}/Unity/extras/memory/src/ -) - -set(UNITY_FLAGS -DUNITY_INCLUDE_CONFIG_H=1 - -Wno-xcore-fptrgroup -) - -set(APP_DEPENDENT_MODULES "lib_mic_array") \ No newline at end of file diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index 4091ecaa..557f0416 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -1,26 +1,12 @@ cmake_minimum_required(VERSION 3.21) include($ENV{XMOS_CMAKE_PATH}/xcommon.cmake) -project(tests-unit ) +project(tests-unit) set(XMOS_SANDBOX_DIR ${CMAKE_CURRENT_LIST_DIR}/../../..) -include(${CMAKE_CURRENT_LIST_DIR}/../test_deps.cmake) - set(APP_HW_TARGET XK-EVK-XU316) - -# Manually grab sources since we want to append unity to them -file(GLOB_RECURSE APP_C_SRCS RELATIVE ${CMAKE_CURRENT_LIST_DIR} "src/*.c") -file(GLOB_RECURSE APP_CXX_SRCS RELATIVE ${CMAKE_CURRENT_LIST_DIR} "src/*.cpp") - -# Modify the included sources so they are relative -set(UNITY_C_SRCS_RELATIVE "") -foreach(ITEM IN LISTS UNITY_C_SRCS) - string(REPLACE "${CMAKE_CURRENT_LIST_DIR}/" "" RELATIVE_ITEM "${ITEM}") - list(APPEND UNITY_C_SRCS_RELATIVE ${RELATIVE_ITEM}) -endforeach() - -list(APPEND APP_C_SRCS ${UNITY_C_SRCS_RELATIVE}) - +set(APP_INCLUDES src) +set(APP_DEPENDENT_MODULES "lib_mic_array" "lib_unity(2.5.2)") set(APP_COMPILER_FLAGS -O2 -g -report @@ -30,9 +16,6 @@ set(APP_COMPILER_FLAGS -O2 -Wno-unknown-pragmas -Wno-format -fxscope - ${UNITY_FLAGS}) - -set(APP_INCLUDES ${UNITY_INCLUDES} - src) + -DUNITY_INCLUDE_CONFIG_H=1) XMOS_REGISTER_APP()