From 1704bfcb95e079033c8478f1104cd6e5d14881f0 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Sun, 3 Feb 2019 03:08:24 +0100 Subject: [PATCH] cmake: tools: test Signed-off-by: Janusz Jankowski --- tools/CMakeLists.txt | 1 + tools/test/CMakeLists.txt | 1 + tools/test/topology/CMakeLists.txt | 32 ++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 tools/test/CMakeLists.txt create mode 100644 tools/test/topology/CMakeLists.txt 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 +)