diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 0f4d566d7..dfdbc222d 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -15,3 +15,4 @@ set(SOF_ROOT_SOURCE_DIRECTORY "${PROJECT_SOURCE_DIR}/..") add_subdirectory(logger) add_subdirectory(eqctl) add_subdirectory(topology) +add_subdirectory(test) diff --git a/tools/test/CMakeLists.txt b/tools/test/CMakeLists.txt new file mode 100644 index 000000000..7463f9cf1 --- /dev/null +++ b/tools/test/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(topology) diff --git a/tools/test/topology/CMakeLists.txt b/tools/test/topology/CMakeLists.txt new file mode 100644 index 000000000..894eb730d --- /dev/null +++ b/tools/test/topology/CMakeLists.txt @@ -0,0 +1,32 @@ +file(GLOB TPLG_DEPS + ../../topology/platform/intel/*.m4 + ../../topology/common/*.m4 + ../../topology/m4/*.m4 + ../../topology/sof/*.m4 +) + +find_program(XARGS NAMES xargs PATHS ENV PATH NO_DEFAULT_PATH) + +if(${XARGS} STREQUAL XARGS-NOTFOUND) + set(USE_XARGS "no") +else() + set(USE_XARGS "yes") +endif() + +add_custom_target(tests + COMMAND ${CMAKE_COMMAND} -E env + SOF_TPLG_BUILD_OUTPUT=${CMAKE_CURRENT_BINARY_DIR} + USE_XARGS=${USE_XARGS} + ./tplg-build.sh + DEPENDS ${TPLG_DEPS} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + VERBATIM + USES_TERMINAL +) + +add_custom_target(tests-clean + COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/*.conf + COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/*.tplg + VERBATIM + USES_TERMINAL +)