diff options
Diffstat (limited to 'src/components/application_manager/test/CMakeLists.txt')
-rw-r--r-- | src/components/application_manager/test/CMakeLists.txt | 65 |
1 files changed, 51 insertions, 14 deletions
diff --git a/src/components/application_manager/test/CMakeLists.txt b/src/components/application_manager/test/CMakeLists.txt index 4d0e7a738f..6c76af526a 100644 --- a/src/components/application_manager/test/CMakeLists.txt +++ b/src/components/application_manager/test/CMakeLists.txt @@ -1,4 +1,37 @@ -#Replace include for mocking singltone +# Copyright (c) 2014, Ford Motor Company +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following +# disclaimer in the documentation and/or other materials provided with the +# distribution. +# +# Neither the name of the Ford Motor Company nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +# TODO{ALeshin}: APPLINK-10792. Do not write tests which use +# application manager(AM) singleton while refactoring of AM is finished. + +# Replace include for mocking singltone get_property(the_include_dirs DIRECTORY "" PROPERTY INCLUDE_DIRECTORIES) set(class_to_mock ${CMAKE_SOURCE_DIR}/src/components/application_manager/include) list(FIND the_include_dirs ${class_to_mock} find_idx) @@ -7,20 +40,24 @@ if(find_idx GREATER -1) endif() set_property(DIRECTORY "" PROPERTY INCLUDE_DIRECTORIES ${the_include_dirs}) -include_directories ( +include_directories( ${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/include ${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/gtest/include + ${COMPONENTS_DIR}/application_manager/include/application_manager/policies ) set(testSources ${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/src/gmock_main.cc - ${AM_TEST_DIR}/command_impl_test.cc + ${AM_TEST_DIR}/command_impl_test.cc + ${COMPONENTS_DIR}/application_manager/test/mobile_message_handler_test.cc + ${AM_TEST_DIR}/request_info_test.cc ) -set (mockedSources + +set(mockedSources ${AM_MOCK_DIR}/src/application_manager_impl.cc ) -set (AM_SOURCES +set(AM_SOURCES ${AM_SOURCE_DIR}/src/policies/policy_handler.cc ${AM_SOURCE_DIR}/src/policies/policy_event_observer.cc @@ -28,6 +65,7 @@ set (AM_SOURCES ${AM_SOURCE_DIR}/src/commands/command_request_impl.cc ${AM_SOURCE_DIR}/src/commands/command_response_impl.cc ${AM_SOURCE_DIR}/src/commands/command_notification_impl.cc + ${AM_SOURCE_DIR}/src/commands/command_notification_from_mobile_impl.cc ${AM_SOURCE_DIR}/src/commands/pending.cc ${AM_SOURCE_DIR}/src/usage_statistics.cc @@ -47,20 +85,14 @@ set (AM_SOURCES include_directories( ${AM_SOURCE_DIR}/policy/src/policy/policy_table/table_struct ) - list(APPEND AM_SOURCES - ${COMPONENTS_DIR}/application_manager/src/policies/pt_exchange_handler_impl.cc - ${COMPONENTS_DIR}/application_manager/src/policies/policy_retry_sequence.cc - ) set(testLibraries gmock - gtest - gmock gmock_main UsageStatistics dl ProtocolLibrary - ) +) set(test_exec_libraries HMI_API @@ -77,6 +109,7 @@ set(test_exec_libraries MediaManager Resumption ) + IF(${CMAKE_SYSTEM_NAME} MATCHES "QNX") list(REMOVE_ITEM test_exec_libraries dl) endif() @@ -89,10 +122,14 @@ if(ENABLE_LOG) endif() add_library("ApplicationManagerTest" ${mockedSources} ${testSources} ${AM_SOURCES}) + target_link_libraries("ApplicationManagerTest" ${testLibraries} AMHMICommandsLibrary AMMobileCommandsLibrary AMEventEngine AMPolicyLibrary) -add_executable(application_manager_test ${testSources}) -target_link_libraries(application_manager_test ApplicationManagerTest ${test_exec_libraries}) +create_test("application_manager_test" "${testSources}" "${ApplicationManagerTest}") +target_link_libraries("application_manager_test" ApplicationManagerTest ${test_exec_libraries}) + +#add_executable(application_manager_test ${testSources}) +#target_link_libraries(application_manager_test ApplicationManagerTest ${test_exec_libraries}) |