find_package(GTest ${GTEST_PACKAGE_CONFIG}) set(INCLUDE_PATH "${ACL_SOURCE_DIR}/include" "${AuthDelegate_INCLUDE_DIR}/test/" "${GTEST_INCLUDE_DIRS}" "${KWD_SOURCE_DIR}/include" "${KITTAI_SOURCE_DIR}/include" "${KITTAI_KEY_WORD_DETECTOR_INCLUDE_DIR}" "${AIP_SOURCE_DIR}/include" "${SpeechSynthesizer_SOURCE_DIR}/include" "${GST_INCLUDE_DIRS}" "${AVSCommon_SOURCE_DIR}/Utils/include" "${MediaPlayer_SOURCE_DIR}/include" "${CONTEXTMANAGER_SOURCE_DIR}/include") if(GSTREAMER_MEDIA_PLAYER) if(KITTAI_KEY_WORD_DETECTOR) set(LINK_PATH ACL AuthDelegate AFML ADSL AIP KWD KITTAI ContextManager MediaPlayer SpeechSynthesizer Integration gtest gmock) elseif(SENSORY_KEY_WORD_DETECTOR) set(LINK_PATH ACL AuthDelegate AFML ADSL AIP KWD SENSORY ContextManager MediaPlayer SpeechSynthesizer Integration gtest gmock) else() set(LINK_PATH ACL AuthDelegate AFML ADSL AIP ContextManager MediaPlayer SpeechSynthesizer Integration gtest gmock) endif() add_definitions(-DGSTREAMER_MEDIA_PLAYER) else() if(KITTAI_KEY_WORD_DETECTOR) set(LINK_PATH ACL AuthDelegate AFML ADSL AIP KWD KITTAI ContextManager SpeechSynthesizer Integration gtest gmock) elseif(SENSORY_KEY_WORD_DETECTOR) set(LINK_PATH ACL AuthDelegate AFML ADSL AIP KWD SENSORY ContextManager SpeechSynthesizer Integration gtest gmock) else() set(LINK_PATH ACL AuthDelegate AFML ADSL AIP ContextManager SpeechSynthesizer Integration gtest gmock) endif() endif() # 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}") 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() 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 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}" COMMAND SpeechSynthesizerIntegrationTest "${SDK_CONFIG_FILE_TARGET}" "${INTEGRATION_INPUTS}" COMMAND ${CTEST_CUSTOM_POST_TEST}) message(STATUS "Please fill ${SDK_CONFIG_FILE_TARGET} before you execute integration tests.") endif()