From e7a43c55f291faa57fa01bd61c31f8f8b11b0855 Mon Sep 17 00:00:00 2001 From: Artur Harasimiuk Date: Wed, 21 Feb 2018 00:31:41 +0100 Subject: [PATCH] ult: don't use mocks sources in projects we should use library igdrcl_mocks to obtain any required mock Change-Id: I2f813f0dc6a2a79e4cdd4eee0e24e1fef83610da --- unit_tests/mt_tests/CMakeLists.txt | 7 ----- unit_tests/mt_tests/mocks/CMakeLists.txt | 30 ---------------------- unit_tests/offline_compiler/CMakeLists.txt | 8 +++--- 3 files changed, 4 insertions(+), 41 deletions(-) delete mode 100644 unit_tests/mt_tests/mocks/CMakeLists.txt diff --git a/unit_tests/mt_tests/CMakeLists.txt b/unit_tests/mt_tests/CMakeLists.txt index 1fd4ced4c2..9c3279ec8a 100644 --- a/unit_tests/mt_tests/CMakeLists.txt +++ b/unit_tests/mt_tests/CMakeLists.txt @@ -30,7 +30,6 @@ add_subdirectory(fixtures) add_subdirectory(helpers) add_subdirectory(indirect_heap) add_subdirectory(memory_manager) -add_subdirectory(mocks) add_subdirectory(os_interface) add_subdirectory(platform) add_subdirectory(utilities) @@ -46,8 +45,6 @@ set(IGDRCL_SRCS_mt_tests_local ${IGDRCL_SOURCE_DIR}/unit_tests/memory_leak_listener.cpp ${IGDRCL_SOURCE_DIR}/unit_tests/ult_configuration.cpp ${IGDRCL_SOURCE_DIR}/unit_tests/fixtures/program_fixture.cpp - ${IGDRCL_SOURCE_DIR}/unit_tests/mocks/mock_compilers.cpp - ${IGDRCL_SOURCE_DIR}/unit_tests/mocks/mock_gmm_resource_info.cpp ${IGDRCL_SOURCE_DIR}/unit_tests/program/evaluate_unhandled_token_ult.cpp ) @@ -63,7 +60,6 @@ set(IGDRCL_SRCS_mt_tests ${IGDRCL_SRCS_mt_tests_indirect_heap} ${IGDRCL_SRCS_mt_tests_local} ${IGDRCL_SRCS_mt_tests_memory_manager} - ${IGDRCL_SRCS_mt_tests_mocks} ${IGDRCL_SRCS_mt_tests_os_interface} ${IGDRCL_SRCS_mt_tests_platform} ${IGDRCL_SRCS_mt_tests_utilities} @@ -73,8 +69,6 @@ if(MSVC) list(APPEND IGDRCL_SRCS_mt_tests ${IGDRCL_SOURCE_DIR}/unit_tests/os_interface/windows/ult_dxgi_factory.cpp ${IGDRCL_SOURCE_DIR}/unit_tests/os_interface/windows/wddm_create.cpp - ${IGDRCL_SOURCE_DIR}/unit_tests/mocks/mock_gmm_page_table_mngr.cpp - ${IGDRCL_SOURCE_DIR}/unit_tests/mocks${BRANCH_DIR_SUFFIX}/mock_gmm_memory.cpp ) endif(MSVC) @@ -137,7 +131,6 @@ source_group("source files\\fixtures" FILES ${IGDRCL_SRCS_mt_tests_fixtures}) source_group("source files\\helpers" FILES ${IGDRCL_SRCS_mt_tests_helpers}) source_group("source files\\indirect_heap" FILES ${IGDRCL_SRCS_mt_tests_indirect_heap}) source_group("source files\\memory_manager" FILES ${IGDRCL_SRCS_mt_tests_memory_manager}) -source_group("source files\\mocks" FILES ${IGDRCL_SRCS_mt_tests_mocks}) source_group("source files\\os_interface" FILES ${IGDRCL_SRCS_mt_tests_os_interface}) source_group("source files\\platform" FILES ${IGDRCL_SRCS_mt_tests_platform}) source_group("source files\\utilities" FILES ${IGDRCL_SRCS_mt_tests_utilities}) diff --git a/unit_tests/mt_tests/mocks/CMakeLists.txt b/unit_tests/mt_tests/mocks/CMakeLists.txt deleted file mode 100644 index c2ab2cb644..0000000000 --- a/unit_tests/mt_tests/mocks/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2018, Intel Corporation -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -# OTHER DEALINGS IN THE SOFTWARE. - -set(IGDRCL_SRCS_mt_tests_mocks - #local files - "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt" - #necessary dependencies from igdrcl_tests - "${IGDRCL_SOURCE_DIR}/unit_tests/mocks/mock_deferrable_deletion.cpp" - "${IGDRCL_SOURCE_DIR}/unit_tests/mocks/mock_deferrable_deletion.h" - "${IGDRCL_SOURCE_DIR}/unit_tests/mocks/mock_kernel.cpp" - "${IGDRCL_SOURCE_DIR}/unit_tests/mocks/mock_kernel.h" - PARENT_SCOPE -) diff --git a/unit_tests/offline_compiler/CMakeLists.txt b/unit_tests/offline_compiler/CMakeLists.txt index 59c195efe2..1537d38a4d 100644 --- a/unit_tests/offline_compiler/CMakeLists.txt +++ b/unit_tests/offline_compiler/CMakeLists.txt @@ -41,9 +41,6 @@ set(IGDRCL_SRCS_offline_compiler_tests ${IGDRCL_SOURCE_DIR}/runtime/memory_manager/deferred_deleter.cpp ${IGDRCL_SOURCE_DIR}/runtime/memory_manager/deferred_deleter.h ${IGDRCL_SOURCE_DIR}/unit_tests/helpers/test_files.cpp - ${IGDRCL_SOURCE_DIR}/unit_tests/mocks/mock_cif.cpp - ${IGDRCL_SOURCE_DIR}/unit_tests/mocks/mock_compilers.cpp - ${IGDRCL_SOURCE_DIR}/unit_tests/mocks/mock_deferred_deleter.cpp ${IGDRCL_SRCS_cloc} ${IGDRCL_SRCS_offline_compiler_mock} ${IGDRCL_SRCS_offline_compiler_tests_linux} @@ -52,7 +49,9 @@ set(IGDRCL_SRCS_offline_compiler_tests ) link_directories(${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + add_executable(cloc_tests ${IGDRCL_SRCS_offline_compiler_tests}) + target_include_directories(cloc_tests PRIVATE ${CLOC_INCLUDES} ${GTEST_INCLUDE_DIR} @@ -71,7 +70,8 @@ endif(CIF_BASE_DIR) add_definitions(${CLOC_LIB_FLAGS_DEFINITIONS}) -target_link_libraries(cloc_tests gtest elflib) +target_link_libraries(cloc_tests igdrcl_mocks gtest elflib) + if(UNIX) target_link_libraries(cloc_tests dl pthread) target_include_directories(cloc_tests PRIVATE