• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
2# SPDX-License-Identifier: MIT
3
4set(TEST_RESOURCES_DIR ${CMAKE_SOURCE_DIR}/test/resources)
5file(MAKE_DIRECTORY ${TEST_RESOURCES_DIR})
6add_definitions (-DTEST_RESOURCE_DIR="${TEST_RESOURCES_DIR}")
7set(TEST_TARGET_NAME "${CMAKE_PROJECT_NAME}-tests")
8
9file(GLOB TEST_SOURCES "test/*")
10file(GLOB TESTS_AUDIO_COMMON "../common/test/Audio/*")
11
12file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test/resources)
13include(../common/cmake/find_catch.cmake)
14
15add_executable("${TEST_TARGET_NAME}" ${COMMON_UTILS_SOURCES} ${COMMON_AUDIO_SOURCES} ${SOURCES} ${TEST_SOURCES} ${TESTS_AUDIO_COMMON})
16
17ExternalProject_Add(passport
18        URL https://raw.githubusercontent.com/Azure-Samples/cognitive-services-speech-sdk/master/sampledata/audiofiles/myVoiceIsMyPassportVerifyMe04.wav
19        DOWNLOAD_NO_EXTRACT 1
20        CONFIGURE_COMMAND ""
21        BUILD_COMMAND ${CMAKE_COMMAND} -E copy <DOWNLOAD_DIR>/myVoiceIsMyPassportVerifyMe04.wav ${CMAKE_CURRENT_SOURCE_DIR}/test/resources
22        INSTALL_COMMAND ""
23        )
24
25add_dependencies(
26        "${TEST_TARGET_NAME}"
27        "passport"
28        "catch2-headers"
29)
30
31target_include_directories("${TEST_TARGET_NAME}" PUBLIC ${TEST_TPIP_INCLUDE}
32    ${ARMNN_INCLUDE_DIR}
33     ${DEPENDENCIES_DIR} ${TEST_RESOURCES_DIR} ${COMMON_INCLUDE_DIR})
34
35target_link_libraries("${TEST_TARGET_NAME}" PUBLIC ${ARMNN_LIBS} -lsndfile -lsamplerate)