2017-03-10 00:01:46 +00:00
|
|
|
find_package(GTest ${GTEST_PACKAGE_CONFIG})
|
2017-02-10 23:39:10 +00:00
|
|
|
|
|
|
|
set(INCLUDE_PATH "${ACL_SOURCE_DIR}/include"
|
2017-05-18 05:02:48 +00:00
|
|
|
"${AuthDelegate_INCLUDE_DIR}/test/"
|
|
|
|
"${GTEST_INCLUDE_DIRS}"
|
|
|
|
"${KWD_SOURCE_DIR}/include"
|
|
|
|
"${KITTAI_SOURCE_DIR}/include"
|
|
|
|
"${KITTAI_KEY_WORD_DETECTOR_INCLUDE_DIR}"
|
2017-06-09 23:23:31 +00:00
|
|
|
"${SENSORY_SOURCE_DIR}/include"
|
|
|
|
"${SENSORY_KEY_WORD_DETECTOR_INCLUDE_DIR}"
|
2017-05-18 05:02:48 +00:00
|
|
|
"${AIP_SOURCE_DIR}/include"
|
2017-05-26 23:06:14 +00:00
|
|
|
"${SpeechSynthesizer_SOURCE_DIR}/include"
|
|
|
|
"${GST_INCLUDE_DIRS}"
|
|
|
|
"${AVSCommon_SOURCE_DIR}/Utils/include"
|
|
|
|
"${MediaPlayer_SOURCE_DIR}/include"
|
2017-05-18 05:02:48 +00:00
|
|
|
"${CONTEXTMANAGER_SOURCE_DIR}/include")
|
2017-02-10 23:39:10 +00:00
|
|
|
|
2017-06-09 23:23:31 +00:00
|
|
|
|
|
|
|
set(LINK_PATH ACL AuthDelegate AFML ADSL AIP ContextManager KWD SpeechSynthesizer Integration gtest gmock)
|
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
if(KITTAI_KEY_WORD_DETECTOR)
|
2017-06-09 23:23:31 +00:00
|
|
|
SET(LINK_PATH ${LINK_PATH} KITTAI)
|
2017-05-26 23:06:14 +00:00
|
|
|
endif()
|
2017-06-09 23:23:31 +00:00
|
|
|
if(SENSORY_KEY_WORD_DETECTOR)
|
|
|
|
SET(LINK_PATH ${LINK_PATH} SENSORY)
|
|
|
|
endif()
|
|
|
|
if(GSTREAMER_MEDIA_PLAYER)
|
|
|
|
SET(LINK_PATH ${LINK_PATH} MediaPlayer)
|
|
|
|
add_definitions(-DGSTREAMER_MEDIA_PLAYER)
|
2017-05-26 23:06:14 +00:00
|
|
|
endif()
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Define a variable for the audio inputs.
|
|
|
|
set(INTEGRATION_INPUTS "${Integration_SOURCE_DIR}/inputs")
|
|
|
|
|
|
|
|
# Copy SDK Json file to the build directory.
|
|
|
|
set(SDK_CONFIG_FILENAME "AlexaClientSDKConfig.json")
|
|
|
|
set(SDK_CONFIG_FILE_SOURCE "${Integration_SOURCE_DIR}/${SDK_CONFIG_FILENAME}")
|
|
|
|
set(SDK_CONFIG_FILE_TARGET "${Integration_BINARY_DIR}/${SDK_CONFIG_FILENAME}")
|
|
|
|
# Use configure_file to support variable substitution later.
|
|
|
|
configure_file("${SDK_CONFIG_FILE_SOURCE}" "${SDK_CONFIG_FILE_TARGET}")
|
|
|
|
|
|
|
|
# Copy AuthServer to the build directory.
|
|
|
|
set(AUTHSERVER_SCRIPT_FILENAME "AuthServer.py")
|
|
|
|
set(AUTHSERVER_SCRIPT_FILE_SOURCE "${AlexaClientSDK_SOURCE_DIR}/tools/AuthServer/${AUTHSERVER_SCRIPT_FILENAME}")
|
|
|
|
set(AUTHSERVER_SCRIPT_FILE_TARGET "${AlexaClientSDK_BINARY_DIR}/AuthServer/${AUTHSERVER_SCRIPT_FILENAME}")
|
|
|
|
# Use configure_file to pass SDK_CONFIG_FILE_TARGET as the default config file.
|
|
|
|
configure_file("${AUTHSERVER_SCRIPT_FILE_SOURCE}" "${AUTHSERVER_SCRIPT_FILE_TARGET}")
|
2017-02-10 23:39:10 +00:00
|
|
|
|
|
|
|
if(BUILD_TESTING)
|
|
|
|
file(GLOB_RECURSE testSourceFiles RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*Test.cpp")
|
|
|
|
foreach (testSourceFile IN LISTS testSourceFiles)
|
|
|
|
get_filename_component(testName ${testSourceFile} NAME_WE)
|
|
|
|
add_executable(${testName} ${testSourceFile})
|
|
|
|
target_include_directories(${testName} PUBLIC "${INCLUDE_PATH}")
|
|
|
|
target_link_libraries(${testName} "${LINK_PATH}")
|
|
|
|
endforeach()
|
|
|
|
|
2017-03-10 00:01:46 +00:00
|
|
|
include(${Integration_BINARY_DIR}/CTestCustom.cmake OPTIONAL)
|
|
|
|
separate_arguments(CTEST_CUSTOM_PRE_TEST UNIX_COMMAND "${CTEST_CUSTOM_PRE_TEST}")
|
|
|
|
separate_arguments(CTEST_CUSTOM_POST_TEST UNIX_COMMAND "${CTEST_CUSTOM_POST_TEST}")
|
|
|
|
add_custom_target(integration
|
2017-05-18 05:02:48 +00:00
|
|
|
COMMAND ${CTEST_CUSTOM_PRE_TEST}
|
|
|
|
COMMAND AlexaAuthorizationDelegateTest "${SDK_CONFIG_FILE_TARGET}"
|
|
|
|
COMMAND AlexaCommunicationsLibraryTest "${SDK_CONFIG_FILE_TARGET}" "${INTEGRATION_INPUTS}"
|
|
|
|
COMMAND AlexaDirectiveSequencerLibraryTest "${SDK_CONFIG_FILE_TARGET}" "${INTEGRATION_INPUTS}"
|
|
|
|
COMMAND AudioInputProcessorIntegrationTest "${SDK_CONFIG_FILE_TARGET}" "${INTEGRATION_INPUTS}"
|
2017-05-26 23:06:14 +00:00
|
|
|
COMMAND SpeechSynthesizerIntegrationTest "${SDK_CONFIG_FILE_TARGET}" "${INTEGRATION_INPUTS}"
|
2017-05-18 05:02:48 +00:00
|
|
|
COMMAND ${CTEST_CUSTOM_POST_TEST})
|
|
|
|
message(STATUS "Please fill ${SDK_CONFIG_FILE_TARGET} before you execute integration tests.")
|
2017-02-10 23:39:10 +00:00
|
|
|
endif()
|