From b6a20f9b2322810623f4e4ee5dbeebe94fba573a Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Wed, 9 Dec 2020 12:18:26 +0100 Subject: [PATCH] Move mock_gmm and mock_gdi to shared Signed-off-by: Mateusz Jablonski --- level_zero/core/test/unit_tests/CMakeLists.txt | 7 ------- .../memory_allocator_multi_device_fixture_windows.cpp | 2 +- opencl/test/unit_test/mocks/mock_wddm.cpp | 2 +- .../test/unit_test/os_interface/windows/gdi_dll_fixture.h | 3 +-- .../unit_test/os_interface/windows/mock_wddm_allocation.h | 2 +- .../os_interface/windows/wddm_kmdaf_listener_tests.cpp | 2 +- shared/test/unit_test/CMakeLists.txt | 4 ---- {opencl => shared}/test/unit_test/mock_gdi/CMakeLists.txt | 4 ++-- {opencl => shared}/test/unit_test/mock_gdi/gdi32_mock.def | 0 {opencl => shared}/test/unit_test/mock_gdi/mock_gdi.cpp | 2 +- {opencl => shared}/test/unit_test/mock_gdi/mock_gdi.h | 0 .../test/unit_test/mock_gdi/mock_gdi_gfx_partition.cpp | 0 {opencl => shared}/test/unit_test/mock_gmm/CMakeLists.txt | 4 ++-- {opencl => shared}/test/unit_test/mock_gmm/mock_gmm.cpp | 0 .../unit_test/os_interface/windows/mock_gdi_interface.h | 3 +-- 15 files changed, 11 insertions(+), 24 deletions(-) rename {opencl => shared}/test/unit_test/mock_gdi/CMakeLists.txt (92%) rename {opencl => shared}/test/unit_test/mock_gdi/gdi32_mock.def (100%) rename {opencl => shared}/test/unit_test/mock_gdi/mock_gdi.cpp (99%) rename {opencl => shared}/test/unit_test/mock_gdi/mock_gdi.h (100%) rename {opencl => shared}/test/unit_test/mock_gdi/mock_gdi_gfx_partition.cpp (100%) rename {opencl => shared}/test/unit_test/mock_gmm/CMakeLists.txt (83%) rename {opencl => shared}/test/unit_test/mock_gmm/mock_gmm.cpp (100%) diff --git a/level_zero/core/test/unit_tests/CMakeLists.txt b/level_zero/core/test/unit_tests/CMakeLists.txt index eb248229c9..acfba03b35 100644 --- a/level_zero/core/test/unit_tests/CMakeLists.txt +++ b/level_zero/core/test/unit_tests/CMakeLists.txt @@ -118,13 +118,6 @@ target_link_libraries(${TARGET_NAME} gmock-gtest ) -if(NOT TARGET mock_gmm AND SKIP_NEO_UNIT_TESTS) - add_subdirectory(${NEO_SOURCE_DIR}/opencl/test/unit_test/mock_gmm ${CMAKE_BINARY_DIR}/mock_gmm) -endif() -if(SKIP_NEO_UNIT_TESTS) - add_subdirectory(${NEO_SOURCE_DIR}/opencl/test/unit_test/mock_gdi ${CMAKE_BINARY_DIR}/mock_gdi) -endif() - target_sources(${TARGET_NAME} PRIVATE $ $ diff --git a/opencl/test/unit_test/fixtures/windows/memory_allocator_multi_device_fixture_windows.cpp b/opencl/test/unit_test/fixtures/windows/memory_allocator_multi_device_fixture_windows.cpp index a4f5ff031c..9c6f55d8e3 100644 --- a/opencl/test/unit_test/fixtures/windows/memory_allocator_multi_device_fixture_windows.cpp +++ b/opencl/test/unit_test/fixtures/windows/memory_allocator_multi_device_fixture_windows.cpp @@ -9,10 +9,10 @@ #include "shared/source/gmm_helper/resource_info.h" #include "shared/source/os_interface/windows/os_environment_win.h" #include "shared/source/os_interface/windows/os_interface.h" +#include "shared/test/unit_test/mock_gdi/mock_gdi.h" #include "shared/test/unit_test/os_interface/windows/mock_gdi_interface.h" #include "opencl/test/unit_test/fixtures/memory_allocator_multi_device_fixture.h" -#include "opencl/test/unit_test/mock_gdi/mock_gdi.h" #include "opencl/test/unit_test/mocks/mock_wddm.h" using namespace NEO; diff --git a/opencl/test/unit_test/mocks/mock_wddm.cpp b/opencl/test/unit_test/mocks/mock_wddm.cpp index 37efca038e..26c3e96b65 100644 --- a/opencl/test/unit_test/mocks/mock_wddm.cpp +++ b/opencl/test/unit_test/mocks/mock_wddm.cpp @@ -13,8 +13,8 @@ #include "shared/source/os_interface/windows/gdi_interface.h" #include "shared/source/os_interface/windows/os_environment_win.h" #include "shared/source/os_interface/windows/wddm_allocation.h" +#include "shared/test/unit_test/mock_gdi/mock_gdi.h" -#include "opencl/test/unit_test/mock_gdi/mock_gdi.h" #include "opencl/test/unit_test/mocks/mock_wddm_residency_allocations_container.h" #include "opencl/test/unit_test/mocks/mock_wddm_residency_logger.h" diff --git a/opencl/test/unit_test/os_interface/windows/gdi_dll_fixture.h b/opencl/test/unit_test/os_interface/windows/gdi_dll_fixture.h index c408da9768..15074670d9 100644 --- a/opencl/test/unit_test/os_interface/windows/gdi_dll_fixture.h +++ b/opencl/test/unit_test/os_interface/windows/gdi_dll_fixture.h @@ -9,8 +9,7 @@ #include "shared/source/helpers/hw_info.h" #include "shared/source/os_interface/os_library.h" #include "shared/test/unit_test/helpers/default_hw_info.h" - -#include "opencl/test/unit_test/mock_gdi/mock_gdi.h" +#include "shared/test/unit_test/mock_gdi/mock_gdi.h" using namespace NEO; diff --git a/opencl/test/unit_test/os_interface/windows/mock_wddm_allocation.h b/opencl/test/unit_test/os_interface/windows/mock_wddm_allocation.h index ef6df64187..67816cdcb4 100644 --- a/opencl/test/unit_test/os_interface/windows/mock_wddm_allocation.h +++ b/opencl/test/unit_test/os_interface/windows/mock_wddm_allocation.h @@ -7,8 +7,8 @@ #pragma once #include "shared/source/os_interface/windows/wddm_allocation.h" +#include "shared/test/unit_test/mock_gdi/mock_gdi.h" -#include "opencl/test/unit_test/mock_gdi/mock_gdi.h" #include "opencl/test/unit_test/mocks/mock_gmm.h" namespace NEO { diff --git a/opencl/test/unit_test/os_interface/windows/wddm_kmdaf_listener_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm_kmdaf_listener_tests.cpp index 70cde015ff..f3e4485851 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_kmdaf_listener_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_kmdaf_listener_tests.cpp @@ -13,10 +13,10 @@ #include "shared/source/os_interface/windows/os_environment_win.h" #include "shared/source/os_interface/windows/wddm/wddm.h" #include "shared/source/os_interface/windows/wddm_allocation.h" +#include "shared/test/unit_test/mock_gdi/mock_gdi.h" #include "shared/test/unit_test/os_interface/windows/mock_gdi_interface.h" #include "opencl/source/platform/platform.h" -#include "opencl/test/unit_test/mock_gdi/mock_gdi.h" #include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/os_interface/windows/mock_kmdaf_listener.h" #include "opencl/test/unit_test/os_interface/windows/mock_wddm_allocation.h" diff --git a/shared/test/unit_test/CMakeLists.txt b/shared/test/unit_test/CMakeLists.txt index 4e644502ec..293db59cd8 100644 --- a/shared/test/unit_test/CMakeLists.txt +++ b/shared/test/unit_test/CMakeLists.txt @@ -40,10 +40,6 @@ if(NOT SKIP_UNIT_TESTS) append_sources_from_properties(CORE_ENABLERS NEO_CORE_SRCS_LINK) - if(NOT TARGET mock_gmm AND SKIP_NEO_UNIT_TESTS) - add_subdirectory(${NEO_SOURCE_DIR}/opencl/test/unit_test/mock_gmm ${CMAKE_BINARY_DIR}/mock_gmm) - endif() - add_executable(${TARGET_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp diff --git a/opencl/test/unit_test/mock_gdi/CMakeLists.txt b/shared/test/unit_test/mock_gdi/CMakeLists.txt similarity index 92% rename from opencl/test/unit_test/mock_gdi/CMakeLists.txt rename to shared/test/unit_test/mock_gdi/CMakeLists.txt index 6e11ca765a..a3fabde466 100644 --- a/opencl/test/unit_test/mock_gdi/CMakeLists.txt +++ b/shared/test/unit_test/mock_gdi/CMakeLists.txt @@ -10,7 +10,7 @@ if(WIN32) set(DEF_FILE "${CMAKE_CURRENT_SOURCE_DIR}/gdi32_mock.def") # Setting up our local list of test files - set(IGDRCL_SRCS_tests_mock_gdi + set(NEO_SHARED_TESTS_mock_gdi ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/mock_gdi.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mock_gdi.h @@ -19,7 +19,7 @@ if(WIN32) ) # this is a DLL - add_library(mock_gdi SHARED ${IGDRCL_SRCS_tests_mock_gdi}) + add_library(mock_gdi SHARED ${NEO_SHARED_TESTS_mock_gdi}) add_definitions(-DINSIDE_PLUGIN) diff --git a/opencl/test/unit_test/mock_gdi/gdi32_mock.def b/shared/test/unit_test/mock_gdi/gdi32_mock.def similarity index 100% rename from opencl/test/unit_test/mock_gdi/gdi32_mock.def rename to shared/test/unit_test/mock_gdi/gdi32_mock.def diff --git a/opencl/test/unit_test/mock_gdi/mock_gdi.cpp b/shared/test/unit_test/mock_gdi/mock_gdi.cpp similarity index 99% rename from opencl/test/unit_test/mock_gdi/mock_gdi.cpp rename to shared/test/unit_test/mock_gdi/mock_gdi.cpp index dc438f2601..4ce9651637 100644 --- a/opencl/test/unit_test/mock_gdi/mock_gdi.cpp +++ b/shared/test/unit_test/mock_gdi/mock_gdi.cpp @@ -5,7 +5,7 @@ * */ -#include "opencl/test/unit_test/mock_gdi/mock_gdi.h" +#include "shared/test/unit_test/mock_gdi/mock_gdi.h" #include "shared/source/helpers/constants.h" diff --git a/opencl/test/unit_test/mock_gdi/mock_gdi.h b/shared/test/unit_test/mock_gdi/mock_gdi.h similarity index 100% rename from opencl/test/unit_test/mock_gdi/mock_gdi.h rename to shared/test/unit_test/mock_gdi/mock_gdi.h diff --git a/opencl/test/unit_test/mock_gdi/mock_gdi_gfx_partition.cpp b/shared/test/unit_test/mock_gdi/mock_gdi_gfx_partition.cpp similarity index 100% rename from opencl/test/unit_test/mock_gdi/mock_gdi_gfx_partition.cpp rename to shared/test/unit_test/mock_gdi/mock_gdi_gfx_partition.cpp diff --git a/opencl/test/unit_test/mock_gmm/CMakeLists.txt b/shared/test/unit_test/mock_gmm/CMakeLists.txt similarity index 83% rename from opencl/test/unit_test/mock_gmm/CMakeLists.txt rename to shared/test/unit_test/mock_gmm/CMakeLists.txt index a2faf72554..b0fd11f86b 100644 --- a/opencl/test/unit_test/mock_gmm/CMakeLists.txt +++ b/shared/test/unit_test/mock_gmm/CMakeLists.txt @@ -8,11 +8,11 @@ set(target_name mock_gmm) project(${target_name}) # Setting up our local list of test files -set(IGDRCL_SRCS_tests_mock_gmm +set(NEO_SHARED_TESTS_mock_gmm ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/mock_gmm.cpp ) -add_library(${target_name} EXCLUDE_FROM_ALL OBJECT ${IGDRCL_SRCS_tests_mock_gmm}) +add_library(${target_name} EXCLUDE_FROM_ALL OBJECT ${NEO_SHARED_TESTS_mock_gmm}) target_include_directories(${target_name} PRIVATE ${WDK_INCLUDE_PATHS} diff --git a/opencl/test/unit_test/mock_gmm/mock_gmm.cpp b/shared/test/unit_test/mock_gmm/mock_gmm.cpp similarity index 100% rename from opencl/test/unit_test/mock_gmm/mock_gmm.cpp rename to shared/test/unit_test/mock_gmm/mock_gmm.cpp diff --git a/shared/test/unit_test/os_interface/windows/mock_gdi_interface.h b/shared/test/unit_test/os_interface/windows/mock_gdi_interface.h index 688f7283c2..ed52052a63 100644 --- a/shared/test/unit_test/os_interface/windows/mock_gdi_interface.h +++ b/shared/test/unit_test/os_interface/windows/mock_gdi_interface.h @@ -7,8 +7,7 @@ #pragma once #include "shared/source/os_interface/windows/gdi_interface.h" - -#include "opencl/test/unit_test/mock_gdi/mock_gdi.h" +#include "shared/test/unit_test/mock_gdi/mock_gdi.h" namespace NEO {