diff --git a/level_zero/cmake/l0_tests.cmake b/level_zero/cmake/l0_tests.cmake index 9f3622e527..cdb3db3396 100644 --- a/level_zero/cmake/l0_tests.cmake +++ b/level_zero/cmake/l0_tests.cmake @@ -44,13 +44,12 @@ add_library(compute_runtime_mockable_extra ${NEO_SHARED_TEST_DIRECTORY}/unit_test/helpers/debug_helpers.cpp ${NEO_SHARED_TEST_DIRECTORY}/unit_test/utilities/cpuintrinsics.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/abort.cpp - ${NEO_SOURCE_DIR}/opencl/test/unit_test/fixtures/mock_execution_environment_gmm_fixture.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/mocks/mock_gmm_page_table_mngr.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/mocks/mock_gmm_resource_info.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/mocks/mock_memory_manager.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/mocks/mock_program.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/utilities/debug_settings_reader_creator.cpp - ${NEO_SOURCE_DIR}/shared/source/debug_settings/debug_settings_manager.cpp + ${NEO_SHARED_DIRECTORY}/debug_settings/debug_settings_manager.cpp ) set_property(TARGET compute_runtime_mockable_extra APPEND_STRING PROPERTY COMPILE_FLAGS ${ASAN_FLAGS} ${TSAN_FLAGS}) @@ -79,7 +78,7 @@ if(WIN32) PRIVATE ${NEO_SOURCE_DIR}/shared/source/dll/windows/environment_variables.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/mocks/mock_gmm_memory_base.cpp - ${NEO_SOURCE_DIR}/opencl/test/unit_test/mocks/mock_wddm.cpp + ${NEO_SHARED_TEST_DIRECTORY}/common/mocks/mock_wddm.cpp ) target_link_libraries(compute_runtime_mockable_extra @@ -92,7 +91,7 @@ if(UNIX) PRIVATE ${NEO_SOURCE_DIR}/opencl/source/dll/linux/allocator_helper.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/os_interface/linux/drm_mock.cpp - ${NEO_SOURCE_DIR}/shared/source/tbx/tbx_sockets_imp.cpp + ${NEO_SHARED_DIRECTORY}/tbx/tbx_sockets_imp.cpp ) target_link_libraries(compute_runtime_mockable_extra dl diff --git a/level_zero/core/test/aub_tests/CMakeLists.txt b/level_zero/core/test/aub_tests/CMakeLists.txt index 5143c93a39..2c3289a704 100644 --- a/level_zero/core/test/aub_tests/CMakeLists.txt +++ b/level_zero/core/test/aub_tests/CMakeLists.txt @@ -112,7 +112,7 @@ else() ${NEO_SOURCE_DIR}/opencl/test/unit_test/os_interface/windows/ult_dxgi_factory.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/os_interface/windows/wddm_calls.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/os_interface/windows/wddm_create.cpp - ${NEO_SOURCE_DIR}/opencl/test/unit_test/mocks/mock_wddm.cpp + ${NEO_SHARED_TEST_DIRECTORY}/common/mocks/mock_wddm.cpp ) endif() diff --git a/level_zero/core/test/unit_tests/os_interface/windows/wddm_l0_tests.cpp b/level_zero/core/test/unit_tests/os_interface/windows/wddm_l0_tests.cpp index 2a356ad391..6e74a29434 100644 --- a/level_zero/core/test/unit_tests/os_interface/windows/wddm_l0_tests.cpp +++ b/level_zero/core/test/unit_tests/os_interface/windows/wddm_l0_tests.cpp @@ -6,8 +6,8 @@ */ #include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/os_interface/windows/wddm_fixture.h" -#include "opencl/test/unit_test/os_interface/windows/wddm_fixture.h" #include "test.h" namespace NEO { diff --git a/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp b/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp index 0afeb137f9..e2022dcf44 100644 --- a/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp +++ b/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp @@ -12,9 +12,9 @@ #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/ult_hw_config.h" #include "shared/test/common/mocks/mock_compilers.h" +#include "shared/test/common/mocks/mock_io_functions.h" #include "shared/test/common/mocks/ult_device_factory.h" -#include "opencl/test/unit_test/mocks/mock_io_functions.h" #include "test.h" #include "level_zero/core/source/driver/driver_handle_imp.h" diff --git a/level_zero/tools/test/unit_tests/sources/metrics/windows/test_metric_enumeration_windows.cpp b/level_zero/tools/test/unit_tests/sources/metrics/windows/test_metric_enumeration_windows.cpp index 4087bbd18a..d648216137 100644 --- a/level_zero/tools/test/unit_tests/sources/metrics/windows/test_metric_enumeration_windows.cpp +++ b/level_zero/tools/test/unit_tests/sources/metrics/windows/test_metric_enumeration_windows.cpp @@ -6,8 +6,8 @@ */ #include "shared/source/os_interface/os_interface.h" +#include "shared/test/common/mocks/mock_wddm.h" -#include "opencl/test/unit_test/mocks/mock_wddm.h" #include "test.h" #include "level_zero/tools/test/unit_tests/sources/metrics/mock_metric.h" diff --git a/manifests/manifest.yml b/manifests/manifest.yml index e0d3e7a8a6..a4bcddbd95 100644 --- a/manifests/manifest.yml +++ b/manifests/manifest.yml @@ -20,7 +20,7 @@ components: infra: branch: infra dest_dir: infra - revision: 8a177b31984d4d7b52a2990cb2947d0fb5bcc5b2 + revision: f442c2c03fb44d60a907400ebed401141430c3fb type: git internal: branch: master diff --git a/opencl/source/command_stream/CMakeLists.txt b/opencl/source/command_stream/CMakeLists.txt index e6396d8025..48df595a17 100644 --- a/opencl/source/command_stream/CMakeLists.txt +++ b/opencl/source/command_stream/CMakeLists.txt @@ -7,8 +7,6 @@ set(RUNTIME_SRCS_COMMAND_STREAM ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/per_dss_backed_buffer.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/aub_command_stream_receiver.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/aub_command_stream_receiver.h ${CMAKE_CURRENT_SOURCE_DIR}/aub_command_stream_receiver_hw.h ${CMAKE_CURRENT_SOURCE_DIR}/aub_command_stream_receiver_hw_base.inl ${CMAKE_CURRENT_SOURCE_DIR}/aub_command_stream_receiver_hw_bdw_plus.inl diff --git a/opencl/source/command_stream/aub_command_stream_receiver_hw.h b/opencl/source/command_stream/aub_command_stream_receiver_hw.h index 89691f8836..72e809485d 100644 --- a/opencl/source/command_stream/aub_command_stream_receiver_hw.h +++ b/opencl/source/command_stream/aub_command_stream_receiver_hw.h @@ -7,13 +7,13 @@ #pragma once #include "shared/source/aub/aub_center.h" +#include "shared/source/command_stream/aub_command_stream_receiver.h" #include "shared/source/helpers/array_count.h" #include "shared/source/memory_manager/os_agnostic_memory_manager.h" #include "shared/source/memory_manager/page_table.h" #include "shared/source/memory_manager/physical_address_allocator.h" #include "shared/source/utilities/spinlock.h" -#include "opencl/source/command_stream/aub_command_stream_receiver.h" #include "opencl/source/command_stream/definitions/command_stream_receiver_simulated_hw.h" #include "aub_mapper.h" diff --git a/opencl/source/command_stream/command_stream_receiver_with_aub_dump.inl b/opencl/source/command_stream/command_stream_receiver_with_aub_dump.inl index 289ff443bc..ded9e9443e 100644 --- a/opencl/source/command_stream/command_stream_receiver_with_aub_dump.inl +++ b/opencl/source/command_stream/command_stream_receiver_with_aub_dump.inl @@ -6,10 +6,10 @@ */ #include "shared/source/aub/aub_center.h" +#include "shared/source/command_stream/aub_command_stream_receiver.h" #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" -#include "opencl/source/command_stream/aub_command_stream_receiver.h" #include "opencl/source/command_stream/command_stream_receiver_with_aub_dump.h" namespace NEO { diff --git a/opencl/source/command_stream/create_command_stream_impl.cpp b/opencl/source/command_stream/create_command_stream_impl.cpp index 39be6d52d6..dca43e8938 100644 --- a/opencl/source/command_stream/create_command_stream_impl.cpp +++ b/opencl/source/command_stream/create_command_stream_impl.cpp @@ -5,12 +5,12 @@ * */ +#include "shared/source/command_stream/aub_command_stream_receiver.h" #include "shared/source/command_stream/tbx_command_stream_receiver.h" #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/os_interface/device_factory.h" -#include "opencl/source/command_stream/aub_command_stream_receiver.h" #include "opencl/source/command_stream/command_stream_receiver_with_aub_dump.h" namespace NEO { diff --git a/opencl/source/dll/create_command_stream.cpp b/opencl/source/dll/create_command_stream.cpp index 379e065712..d14e556508 100644 --- a/opencl/source/dll/create_command_stream.cpp +++ b/opencl/source/dll/create_command_stream.cpp @@ -5,11 +5,11 @@ * */ +#include "shared/source/command_stream/aub_command_stream_receiver.h" #include "shared/source/command_stream/device_command_stream.h" #include "shared/source/command_stream/tbx_command_stream_receiver.h" #include "shared/source/helpers/hw_info.h" -#include "opencl/source/command_stream/aub_command_stream_receiver.h" #include "opencl/source/command_stream/command_stream_receiver_with_aub_dump.h" #include "opencl/source/command_stream/create_command_stream_impl.h" diff --git a/opencl/test/unit_test/api/cl_add_comment_to_aub_tests.inl b/opencl/test/unit_test/api/cl_add_comment_to_aub_tests.inl index 7fa9133d2d..ff8488e237 100644 --- a/opencl/test/unit_test/api/cl_add_comment_to_aub_tests.inl +++ b/opencl/test/unit_test/api/cl_add_comment_to_aub_tests.inl @@ -7,13 +7,13 @@ #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" +#include "shared/test/common/mocks/mock_aub_center.h" #include "shared/test/common/mocks/mock_aub_manager.h" #include "opencl/source/cl_device/cl_device.h" #include "opencl/source/context/context.h" #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/api/cl_api_tests.h" -#include "opencl/test/unit_test/mocks/mock_aub_center.h" using namespace NEO; diff --git a/opencl/test/unit_test/aub/aub_center_tests.cpp b/opencl/test/unit_test/aub/aub_center_tests.cpp index 071ccf6889..8dafca4814 100644 --- a/opencl/test/unit_test/aub/aub_center_tests.cpp +++ b/opencl/test/unit_test/aub/aub_center_tests.cpp @@ -12,10 +12,10 @@ #include "shared/source/helpers/hw_info.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/default_hw_info.h" +#include "shared/test/common/mocks/mock_aub_center.h" #include "shared/test/common/mocks/mock_aub_manager.h" #include "opencl/test/unit_test/helpers/hw_helper_tests.h" -#include "opencl/test/unit_test/mocks/mock_aub_center.h" #include "gtest/gtest.h" #include "third_party/aub_stream/headers/aubstream.h" diff --git a/opencl/test/unit_test/aub/aub_center_using_aubstream_stubs_tests.cpp b/opencl/test/unit_test/aub/aub_center_using_aubstream_stubs_tests.cpp index 07dbcfce56..66946951b2 100644 --- a/opencl/test/unit_test/aub/aub_center_using_aubstream_stubs_tests.cpp +++ b/opencl/test/unit_test/aub/aub_center_using_aubstream_stubs_tests.cpp @@ -12,8 +12,7 @@ #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/helpers/variable_backup.h" - -#include "opencl/test/unit_test/mocks/mock_aub_center.h" +#include "shared/test/common/mocks/mock_aub_center.h" #include "gtest/gtest.h" #include "third_party/aub_stream/headers/aubstream.h" diff --git a/opencl/test/unit_test/command_queue/enqueue_command_without_kernel_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_command_without_kernel_tests.cpp index 2e1fb5a941..dac0f86d3a 100644 --- a/opencl/test/unit_test/command_queue/enqueue_command_without_kernel_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_command_without_kernel_tests.cpp @@ -8,6 +8,7 @@ #include "shared/source/helpers/timestamp_packet.h" #include "shared/source/memory_manager/surface.h" #include "shared/source/os_interface/os_context.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/mock_graphics_allocation.h" #include "opencl/source/event/event_builder.h" @@ -19,7 +20,6 @@ #include "opencl/test/unit_test/mocks/mock_command_queue.h" #include "opencl/test/unit_test/mocks/mock_csr.h" #include "opencl/test/unit_test/mocks/mock_event.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_kernel.h" #include "opencl/test/unit_test/mocks/mock_mdi.h" #include "opencl/test/unit_test/mocks/mock_timestamp_container.h" diff --git a/opencl/test/unit_test/command_queue/enqueue_read_buffer_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_read_buffer_tests.cpp index 42ed5ba4c2..ddd97a5977 100644 --- a/opencl/test/unit_test/command_queue/enqueue_read_buffer_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_read_buffer_tests.cpp @@ -11,6 +11,7 @@ #include "shared/source/memory_manager/allocations_list.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/unit_test_helper.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "opencl/source/built_ins/builtins_dispatch_builder.h" #include "opencl/source/helpers/dispatch_info.h" @@ -19,7 +20,6 @@ #include "opencl/test/unit_test/gen_common/gen_commands_common_validation.h" #include "opencl/test/unit_test/mocks/mock_buffer.h" #include "opencl/test/unit_test/mocks/mock_command_queue.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "test.h" #include "reg_configs_common.h" diff --git a/opencl/test/unit_test/command_queue/enqueue_write_buffer_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_write_buffer_tests.cpp index 7e374c31ca..17b6029757 100644 --- a/opencl/test/unit_test/command_queue/enqueue_write_buffer_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_write_buffer_tests.cpp @@ -9,6 +9,7 @@ #include "shared/source/memory_manager/allocations_list.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/unit_test_helper.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "opencl/source/built_ins/builtins_dispatch_builder.h" #include "opencl/source/helpers/dispatch_info.h" @@ -17,7 +18,6 @@ #include "opencl/test/unit_test/gen_common/gen_commands_common_validation.h" #include "opencl/test/unit_test/mocks/mock_buffer.h" #include "opencl/test/unit_test/mocks/mock_command_queue.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "test.h" #include "reg_configs_common.h" diff --git a/opencl/test/unit_test/command_stream/aub_command_stream_receiver_1_tests.cpp b/opencl/test/unit_test/command_stream/aub_command_stream_receiver_1_tests.cpp index cd75ea5f2b..b1e3e98aab 100644 --- a/opencl/test/unit_test/command_stream/aub_command_stream_receiver_1_tests.cpp +++ b/opencl/test/unit_test/command_stream/aub_command_stream_receiver_1_tests.cpp @@ -9,18 +9,18 @@ #include "shared/source/helpers/hw_helper.h" #include "shared/source/os_interface/os_context.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/mocks/mock_aub_center.h" #include "shared/test/common/mocks/mock_aub_manager.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/mock_graphics_allocation.h" +#include "shared/test/unit_test/fixtures/mock_aub_center_fixture.h" #include "opencl/source/helpers/hardware_context_controller.h" #include "opencl/test/unit_test/fixtures/aub_command_stream_receiver_fixture.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" -#include "opencl/test/unit_test/fixtures/mock_aub_center_fixture.h" #include "opencl/test/unit_test/libult/ult_aub_command_stream_receiver.h" -#include "opencl/test/unit_test/mocks/mock_aub_center.h" #include "opencl/test/unit_test/mocks/mock_aub_csr.h" #include "opencl/test/unit_test/mocks/mock_aub_subcapture_manager.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_gmm.h" #include "opencl/test/unit_test/mocks/mock_kernel.h" #include "opencl/test/unit_test/mocks/mock_mdi.h" diff --git a/opencl/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp b/opencl/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp index 8e61a1ac33..127aa98129 100644 --- a/opencl/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp +++ b/opencl/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp @@ -10,22 +10,22 @@ #include "shared/source/helpers/hw_helper.h" #include "shared/source/os_interface/os_context.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/mocks/mock_aub_center.h" +#include "shared/test/common/mocks/mock_aub_file_stream.h" #include "shared/test/common/mocks/mock_aub_manager.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/ult_device_factory.h" +#include "shared/test/unit_test/fixtures/mock_aub_center_fixture.h" #include "opencl/source/helpers/hardware_context_controller.h" #include "opencl/source/mem_obj/mem_obj_helper.h" #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/fixtures/aub_command_stream_receiver_fixture.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" -#include "opencl/test/unit_test/fixtures/mock_aub_center_fixture.h" -#include "opencl/test/unit_test/mocks/mock_aub_center.h" #include "opencl/test/unit_test/mocks/mock_aub_csr.h" -#include "opencl/test/unit_test/mocks/mock_aub_file_stream.h" #include "opencl/test/unit_test/mocks/mock_aub_subcapture_manager.h" #include "opencl/test/unit_test/mocks/mock_command_queue.h" #include "opencl/test/unit_test/mocks/mock_csr.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_gmm.h" #include "opencl/test/unit_test/mocks/mock_kernel.h" #include "opencl/test/unit_test/mocks/mock_mdi.h" diff --git a/opencl/test/unit_test/command_stream/aub_file_stream_tests.cpp b/opencl/test/unit_test/command_stream/aub_file_stream_tests.cpp index 84b3458cd5..15cf9e005a 100644 --- a/opencl/test/unit_test/command_stream/aub_file_stream_tests.cpp +++ b/opencl/test/unit_test/command_stream/aub_file_stream_tests.cpp @@ -8,7 +8,10 @@ #include "shared/source/aub_mem_dump/page_table_entry_bits.h" #include "shared/source/os_interface/os_context.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/mocks/mock_aub_center.h" +#include "shared/test/common/mocks/mock_aub_file_stream.h" #include "shared/test/common/mocks/mock_aub_manager.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/mock_graphics_allocation.h" #include "opencl/source/command_stream/aub_command_stream_receiver_hw.h" @@ -16,11 +19,8 @@ #include "opencl/source/helpers/neo_driver_version.h" #include "opencl/test/unit_test/fixtures/aub_command_stream_receiver_fixture.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" -#include "opencl/test/unit_test/mocks/mock_aub_center.h" #include "opencl/test/unit_test/mocks/mock_aub_csr.h" -#include "opencl/test/unit_test/mocks/mock_aub_file_stream.h" #include "opencl/test/unit_test/mocks/mock_aub_subcapture_manager.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_mdi.h" #include "opencl/test/unit_test/mocks/mock_os_context.h" #include "test.h" diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp index 7852a0906f..feb9ab4f69 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp @@ -21,6 +21,7 @@ #include "shared/source/utilities/tag_allocator.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/unit_test_helper.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/mock_graphics_allocation.h" #include "shared/test/common/mocks/ult_device_factory.h" #include "shared/test/common/test_macros/test_checks_shared.h" @@ -37,7 +38,6 @@ #include "opencl/test/unit_test/mocks/mock_builtins.h" #include "opencl/test/unit_test/mocks/mock_context.h" #include "opencl/test/unit_test/mocks/mock_csr.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_hw_helper.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" #include "opencl/test/unit_test/mocks/mock_platform.h" diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_with_aub_dump_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_with_aub_dump_tests.cpp index 3bd48e5f74..a5ce9b6e0d 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_with_aub_dump_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_with_aub_dump_tests.cpp @@ -13,19 +13,20 @@ #include "shared/source/helpers/timestamp_packet.h" #include "shared/source/os_interface/os_context.h" #include "shared/source/utilities/tag_allocator.h" +#include "shared/test/common/fixtures/device_fixture.h" +#include "shared/test/common/mocks/mock_aub_center.h" #include "shared/test/common/mocks/mock_aub_manager.h" +#include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/unit_test/fixtures/mock_aub_center_fixture.h" #include "opencl/source/command_stream/aub_command_stream_receiver_hw.h" #include "opencl/source/command_stream/command_stream_receiver_with_aub_dump.h" #include "opencl/source/command_stream/command_stream_receiver_with_aub_dump.inl" #include "opencl/source/helpers/dispatch_info.h" #include "opencl/source/platform/platform.h" -#include "opencl/test/unit_test/fixtures/mock_aub_center_fixture.h" #include "opencl/test/unit_test/libult/ult_command_stream_receiver.h" #include "opencl/test/unit_test/mocks/mock_allocation_properties.h" -#include "opencl/test/unit_test/mocks/mock_aub_center.h" #include "opencl/test/unit_test/mocks/mock_aub_csr.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_os_context.h" #include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" @@ -117,10 +118,12 @@ struct MyMockCsrWithAubDump : CommandStreamReceiverWithAUBDump { } }; -struct CommandStreamReceiverWithAubDumpTest : public ::testing::TestWithParam, MockAubCenterFixture { +struct CommandStreamReceiverWithAubDumpTest : public ::testing::TestWithParam, MockAubCenterFixture, DeviceFixture { void SetUp() override { + DeviceFixture::SetUp(); MockAubCenterFixture::SetUp(); - executionEnvironment = platform()->peekExecutionEnvironment(); + setMockAubCenter(pDevice->getRootDeviceEnvironmentRef()); + executionEnvironment = pDevice->getExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); memoryManager = executionEnvironment->memoryManager.get(); ASSERT_NE(nullptr, memoryManager); @@ -138,8 +141,9 @@ struct CommandStreamReceiverWithAubDumpTest : public ::testing::TestWithParam; +struct CommandStreamReceiverWithAubDumpSimpleTest : Test, DeviceFixture { + void SetUp() override { + DeviceFixture::SetUp(); + MockAubCenterFixture::SetUp(); + setMockAubCenter(pDevice->getRootDeviceEnvironmentRef()); + } + void TearDown() override { + MockAubCenterFixture::TearDown(); + DeviceFixture::TearDown(); + } +}; HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenCsrWithAubDumpWhenSettingOsContextThenReplicateItToAubCsr) { - ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment(); + ExecutionEnvironment *executionEnvironment = pDevice->getExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); DeviceBitfield deviceBitfield(1); CommandStreamReceiverWithAUBDump> csrWithAubDump("aubfile", *executionEnvironment, 0, deviceBitfield); @@ -166,7 +180,7 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenCsrWithAubDumpWhenSett } HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenAubManagerAvailableWhenTbxCsrWithAubDumpIsCreatedThenAubCsrIsNotCreated) { - ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment(); + ExecutionEnvironment *executionEnvironment = pDevice->getExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); std::string fileName = "file_name.aub"; MockAubManager *mockManager = new MockAubManager(); @@ -181,7 +195,7 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenAubManagerAvailableWhe } HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenAubManagerAvailableWhenHwCsrWithAubDumpIsCreatedThenAubCsrIsCreated) { - ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment(); + ExecutionEnvironment *executionEnvironment = pDevice->getExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); auto gmmHelper = executionEnvironment->rootDeviceEnvironments[0]->getGmmHelper(); @@ -198,7 +212,7 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenAubManagerAvailableWhe } HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenCsrWithAubDumpWhenWaitingForTaskCountThenAddPollForCompletion) { - auto executionEnvironment = platform()->peekExecutionEnvironment(); + auto executionEnvironment = pDevice->getExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); auto gmmHelper = executionEnvironment->rootDeviceEnvironments[0]->getGmmHelper(); @@ -223,7 +237,7 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenCsrWithAubDumpWhenWait } HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenCsrWithAubDumpWhenCreatingAubCsrThenInitializeTagAllocation) { - auto executionEnvironment = platform()->peekExecutionEnvironment(); + auto executionEnvironment = pDevice->getExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); auto gmmHelper = executionEnvironment->rootDeviceEnvironments[0]->getGmmHelper(); @@ -240,7 +254,7 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenCsrWithAubDumpWhenCrea } HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenAubCsrWithHwWhenAddingCommentThenAddCommentToAubManager) { - auto executionEnvironment = platform()->peekExecutionEnvironment(); + auto executionEnvironment = pDevice->getExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); auto gmmHelper = executionEnvironment->rootDeviceEnvironments[0]->getGmmHelper(); @@ -258,7 +272,7 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenAubCsrWithHwWhenAdding } HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenAubCsrWithTbxWhenAddingCommentThenDontAddCommentToAubManager) { - auto executionEnvironment = platform()->peekExecutionEnvironment(); + auto executionEnvironment = pDevice->getExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); auto gmmHelper = executionEnvironment->rootDeviceEnvironments[0]->getGmmHelper(); @@ -376,7 +390,7 @@ HWTEST_F(SimulatedCsrTest, givenTbxWithAubDumpCsrTypeWhenCreateCommandStreamRece HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenNullAubManagerAvailableWhenTbxCsrWithAubDumpIsCreatedThenAubCsrIsCreated) { MockAubCenter *mockAubCenter = new MockAubCenter(); - ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment(); + ExecutionEnvironment *executionEnvironment = pDevice->getExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); DeviceBitfield deviceBitfield(1); diff --git a/opencl/test/unit_test/command_stream/create_command_stream_receiver_tests.cpp b/opencl/test/unit_test/command_stream/create_command_stream_receiver_tests.cpp index db5c028b31..66fe63e5f1 100644 --- a/opencl/test/unit_test/command_stream/create_command_stream_receiver_tests.cpp +++ b/opencl/test/unit_test/command_stream/create_command_stream_receiver_tests.cpp @@ -11,9 +11,9 @@ #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/ult_hw_config.h" #include "shared/test/common/helpers/variable_backup.h" +#include "shared/test/unit_test/fixtures/mock_aub_center_fixture.h" #include "opencl/source/command_stream/command_stream_receiver_with_aub_dump.h" -#include "opencl/test/unit_test/fixtures/mock_aub_center_fixture.h" #include "opencl/test/unit_test/helpers/execution_environment_helper.h" #include "opencl/test/unit_test/libult/create_command_stream.h" #include "test.h" diff --git a/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp b/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp index 68b0d18f49..bcacb8c065 100644 --- a/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp +++ b/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp @@ -6,6 +6,7 @@ */ #include "shared/source/aub_mem_dump/aub_alloc_dump.h" +#include "shared/source/command_stream/aub_command_stream_receiver.h" #include "shared/source/command_stream/command_stream_receiver_hw.h" #include "shared/source/command_stream/tbx_command_stream_receiver_hw.h" #include "shared/source/debug_settings/debug_settings_manager.h" @@ -17,11 +18,13 @@ #include "shared/test/common/cmd_parse/gen_cmd_parse.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/variable_backup.h" +#include "shared/test/common/mocks/mock_aub_center.h" #include "shared/test/common/mocks/mock_aub_manager.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/mock_graphics_allocation.h" #include "shared/test/common/mocks/mock_tbx_csr.h" +#include "shared/test/unit_test/fixtures/mock_aub_center_fixture.h" -#include "opencl/source/command_stream/aub_command_stream_receiver.h" #include "opencl/source/command_stream/command_stream_receiver_with_aub_dump.h" #include "opencl/source/helpers/hardware_context_controller.h" #include "opencl/source/mem_obj/buffer.h" @@ -29,12 +32,9 @@ #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/command_queue/command_queue_fixture.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" -#include "opencl/test/unit_test/fixtures/mock_aub_center_fixture.h" #include "opencl/test/unit_test/mocks/mock_allocation_properties.h" -#include "opencl/test/unit_test/mocks/mock_aub_center.h" #include "opencl/test/unit_test/mocks/mock_aub_subcapture_manager.h" #include "opencl/test/unit_test/mocks/mock_command_queue.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_kernel.h" #include "opencl/test/unit_test/mocks/mock_mdi.h" #include "opencl/test/unit_test/mocks/mock_os_context.h" diff --git a/opencl/test/unit_test/d3d_sharing/d3d_tests_part2.cpp b/opencl/test/unit_test/d3d_sharing/d3d_tests_part2.cpp index 041eff4521..986dad7535 100644 --- a/opencl/test/unit_test/d3d_sharing/d3d_tests_part2.cpp +++ b/opencl/test/unit_test/d3d_sharing/d3d_tests_part2.cpp @@ -9,6 +9,7 @@ #include "shared/source/os_interface/os_interface.h" #include "shared/source/utilities/arrayref.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/mocks/mock_wddm.h" #include "opencl/source/api/api.h" #include "opencl/source/mem_obj/image.h" @@ -19,7 +20,6 @@ #include "opencl/source/sharings/d3d/d3d_surface.h" #include "opencl/source/sharings/d3d/d3d_texture.h" #include "opencl/test/unit_test/fixtures/d3d_test_fixture.h" -#include "opencl/test/unit_test/mocks/mock_wddm.h" #include "gmock/gmock.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/device/device_caps_tests.cpp b/opencl/test/unit_test/device/device_caps_tests.cpp index b4d7557c4b..0bee1bb96d 100644 --- a/opencl/test/unit_test/device/device_caps_tests.cpp +++ b/opencl/test/unit_test/device/device_caps_tests.cpp @@ -13,6 +13,7 @@ #include "shared/test/common/helpers/variable_backup.h" #include "shared/test/common/mocks/mock_device.h" #include "shared/test/common/mocks/mock_driver_info.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/mock_sip.h" #include "opencl/source/platform/extensions.h" @@ -20,7 +21,6 @@ #include "opencl/test/unit_test/helpers/hw_helper_tests.h" #include "opencl/test/unit_test/helpers/raii_hw_helper.h" #include "opencl/test/unit_test/mocks/mock_builtins.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/ult_cl_device_factory.h" #include "opencl/test/unit_test/test_macros/test_checks_ocl.h" diff --git a/opencl/test/unit_test/device/device_tests.cpp b/opencl/test/unit_test/device/device_tests.cpp index 5242a31f2b..09d721b229 100644 --- a/opencl/test/unit_test/device/device_tests.cpp +++ b/opencl/test/unit_test/device/device_tests.cpp @@ -15,6 +15,7 @@ #include "shared/test/common/helpers/unit_test_helper.h" #include "shared/test/common/helpers/variable_backup.h" #include "shared/test/common/mocks/mock_driver_info.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/ult_device_factory.h" #include "opencl/source/platform/platform.h" @@ -22,7 +23,6 @@ #include "opencl/test/unit_test/libult/ult_command_stream_receiver.h" #include "opencl/test/unit_test/mocks/mock_context.h" #include "opencl/test/unit_test/mocks/mock_csr.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" #include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" diff --git a/opencl/test/unit_test/device/device_win_timers_tests.cpp b/opencl/test/unit_test/device/device_win_timers_tests.cpp index 1c74fc50f6..22b2ba8972 100644 --- a/opencl/test/unit_test/device/device_win_timers_tests.cpp +++ b/opencl/test/unit_test/device/device_win_timers_tests.cpp @@ -6,12 +6,12 @@ */ #include "shared/source/execution_environment/root_device_environment.h" +#include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/mocks/mock_wddm.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_ostime.h" #include "opencl/test/unit_test/mocks/mock_ostime_win.h" -#include "opencl/test/unit_test/mocks/mock_wddm.h" #include "test.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/execution_environment/execution_environment_tests.cpp b/opencl/test/unit_test/execution_environment/execution_environment_tests.cpp index d5d4cfd52d..e282e7296c 100644 --- a/opencl/test/unit_test/execution_environment/execution_environment_tests.cpp +++ b/opencl/test/unit_test/execution_environment/execution_environment_tests.cpp @@ -19,13 +19,13 @@ #include "shared/source/source_level_debugger/source_level_debugger.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/mocks/mock_device.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/mock_memory_operations_handler.h" #include "shared/test/unit_test/utilities/destructor_counted.h" #include "opencl/source/cl_device/cl_device.h" #include "opencl/test/unit_test/mocks/mock_async_event_handler.h" #include "opencl/test/unit_test/mocks/mock_cl_execution_environment.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" #include "test.h" diff --git a/opencl/test/unit_test/fixtures/CMakeLists.txt b/opencl/test/unit_test/fixtures/CMakeLists.txt index 0cb4992013..6873ff4f79 100644 --- a/opencl/test/unit_test/fixtures/CMakeLists.txt +++ b/opencl/test/unit_test/fixtures/CMakeLists.txt @@ -36,9 +36,6 @@ set(IGDRCL_SRCS_tests_fixtures ${CMAKE_CURRENT_SOURCE_DIR}/memory_allocator_multi_device_fixture.h ${CMAKE_CURRENT_SOURCE_DIR}/memory_manager_fixture.cpp ${CMAKE_CURRENT_SOURCE_DIR}/memory_manager_fixture.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_aub_center_fixture.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_execution_environment_gmm_fixture.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/mock_execution_environment_gmm_fixture.h ${CMAKE_CURRENT_SOURCE_DIR}/multi_root_device_fixture.h ${CMAKE_CURRENT_SOURCE_DIR}/one_mip_level_image_fixture.h ${CMAKE_CURRENT_SOURCE_DIR}/platform_fixture.cpp diff --git a/opencl/test/unit_test/fixtures/aub_command_stream_receiver_fixture.h b/opencl/test/unit_test/fixtures/aub_command_stream_receiver_fixture.h index fae35f804b..93a36e9a9f 100644 --- a/opencl/test/unit_test/fixtures/aub_command_stream_receiver_fixture.h +++ b/opencl/test/unit_test/fixtures/aub_command_stream_receiver_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2020 Intel Corporation + * Copyright (C) 2019-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -7,8 +7,9 @@ #pragma once +#include "shared/test/unit_test/fixtures/mock_aub_center_fixture.h" + #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" -#include "opencl/test/unit_test/fixtures/mock_aub_center_fixture.h" namespace NEO { struct AubCommandStreamReceiverFixture : public ClDeviceFixture, MockAubCenterFixture { diff --git a/opencl/test/unit_test/fixtures/dispatch_flags_fixture.h b/opencl/test/unit_test/fixtures/dispatch_flags_fixture.h index 8f89cca253..89d233ef09 100644 --- a/opencl/test/unit_test/fixtures/dispatch_flags_fixture.h +++ b/opencl/test/unit_test/fixtures/dispatch_flags_fixture.h @@ -9,11 +9,11 @@ #include "shared/source/os_interface/os_context.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/mocks/mock_device.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_cl_device.h" #include "opencl/test/unit_test/mocks/mock_context.h" #include "opencl/test/unit_test/mocks/mock_csr.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" namespace NEO { struct DispatchFlagsTests : public ::testing::Test { 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 92b23d3d0c..7fa050ede1 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 @@ -10,10 +10,10 @@ #include "shared/source/os_interface/os_interface.h" #include "shared/source/os_interface/windows/os_environment_win.h" #include "shared/test/common/mock_gdi/mock_gdi.h" +#include "shared/test/common/mocks/mock_wddm.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/mocks/mock_wddm.h" using namespace NEO; diff --git a/opencl/test/unit_test/gen12lp/tgllp/test_hw_info_config_tgllp.cpp b/opencl/test/unit_test/gen12lp/tgllp/test_hw_info_config_tgllp.cpp index 13cea25334..9efd612a67 100644 --- a/opencl/test/unit_test/gen12lp/tgllp/test_hw_info_config_tgllp.cpp +++ b/opencl/test/unit_test/gen12lp/tgllp/test_hw_info_config_tgllp.cpp @@ -7,8 +7,8 @@ #include "shared/source/os_interface/device_factory.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/mocks/mock_execution_environment.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "test.h" using namespace NEO; diff --git a/opencl/test/unit_test/gen12lp/windows/wddm_tests_gen12lp.cpp b/opencl/test/unit_test/gen12lp/windows/wddm_tests_gen12lp.cpp index 39cad6b0f4..4fb8c36a01 100644 --- a/opencl/test/unit_test/gen12lp/windows/wddm_tests_gen12lp.cpp +++ b/opencl/test/unit_test/gen12lp/windows/wddm_tests_gen12lp.cpp @@ -9,10 +9,10 @@ #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/os_interface/os_interface.h" #include "shared/source/os_interface/windows/gdi_interface.h" +#include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/mocks/mock_wddm.h" +#include "shared/test/common/os_interface/windows/gdi_dll_fixture.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" -#include "opencl/test/unit_test/mocks/mock_wddm.h" -#include "opencl/test/unit_test/os_interface/windows/gdi_dll_fixture.h" #include "test.h" #include "mock_gmm_memory.h" diff --git a/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp b/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp index cf36f4d8f1..fed6255475 100644 --- a/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp +++ b/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp @@ -13,13 +13,13 @@ #include "shared/source/memory_manager/os_agnostic_memory_manager.h" #include "shared/source/os_interface/device_factory.h" #include "shared/source/sku_info/operations/sku_info_transfer.h" +#include "shared/test/common/fixtures/mock_execution_environment_gmm_fixture.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/variable_backup.h" #include "shared/test/common/mocks/mock_device.h" #include "shared/test/common/mocks/mock_graphics_allocation.h" #include "opencl/source/helpers/gmm_types_converter.h" -#include "opencl/test/unit_test/fixtures/mock_execution_environment_gmm_fixture.h" #include "opencl/test/unit_test/mocks/mock_context.h" #include "opencl/test/unit_test/mocks/mock_gmm.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" diff --git a/opencl/test/unit_test/helpers/timestamp_packet_1_tests.cpp b/opencl/test/unit_test/helpers/timestamp_packet_1_tests.cpp index a2eef960d2..8244b4bf33 100644 --- a/opencl/test/unit_test/helpers/timestamp_packet_1_tests.cpp +++ b/opencl/test/unit_test/helpers/timestamp_packet_1_tests.cpp @@ -11,6 +11,7 @@ #include "shared/test/common/cmd_parse/hw_parse.h" #include "shared/test/common/helpers/dispatch_flags_helper.h" #include "shared/test/common/mocks/mock_device.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/unit_test/utilities/base_object_utils.h" #include "opencl/source/command_queue/gpgpu_walker.h" @@ -19,7 +20,6 @@ #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/helpers/timestamp_packet_tests.h" #include "opencl/test/unit_test/mocks/mock_csr.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_mdi.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" #include "opencl/test/unit_test/mocks/mock_platform.h" diff --git a/opencl/test/unit_test/helpers/transfer_properties_tests.cpp b/opencl/test/unit_test/helpers/transfer_properties_tests.cpp index bfe2737668..a7cbb01e91 100644 --- a/opencl/test/unit_test/helpers/transfer_properties_tests.cpp +++ b/opencl/test/unit_test/helpers/transfer_properties_tests.cpp @@ -6,11 +6,11 @@ */ #include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "opencl/source/cl_device/cl_device.h" #include "opencl/source/helpers/properties_helper.h" #include "opencl/test/unit_test/mocks/mock_buffer.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/libult/create_command_stream.cpp b/opencl/test/unit_test/libult/create_command_stream.cpp index 919c78ff96..cb29fdf0c7 100644 --- a/opencl/test/unit_test/libult/create_command_stream.cpp +++ b/opencl/test/unit_test/libult/create_command_stream.cpp @@ -7,6 +7,7 @@ #include "opencl/test/unit_test/libult/create_command_stream.h" +#include "shared/source/command_stream/aub_command_stream_receiver.h" #include "shared/source/command_stream/command_stream_receiver.h" #include "shared/source/command_stream/tbx_command_stream_receiver.h" #include "shared/source/execution_environment/root_device_environment.h" @@ -15,7 +16,6 @@ #include "shared/test/common/helpers/ult_hw_config.h" #include "shared/test/common/mocks/ult_device_factory.h" -#include "opencl/source/command_stream/aub_command_stream_receiver.h" #include "opencl/source/command_stream/create_command_stream_impl.h" #include "opencl/test/unit_test/libult/ult_command_stream_receiver.h" diff --git a/opencl/test/unit_test/libult/io_functions.cpp b/opencl/test/unit_test/libult/io_functions.cpp index dd2947d794..718fa09d9d 100644 --- a/opencl/test/unit_test/libult/io_functions.cpp +++ b/opencl/test/unit_test/libult/io_functions.cpp @@ -5,7 +5,7 @@ * */ -#include "opencl/test/unit_test/mocks/mock_io_functions.h" +#include "shared/test/common/mocks/mock_io_functions.h" namespace NEO { namespace IoFunctions { diff --git a/opencl/test/unit_test/linux/main_linux_dll.cpp b/opencl/test/unit_test/linux/main_linux_dll.cpp index 1ea7cde8a4..75809c07b3 100644 --- a/opencl/test/unit_test/linux/main_linux_dll.cpp +++ b/opencl/test/unit_test/linux/main_linux_dll.cpp @@ -17,11 +17,11 @@ #include "shared/test/common/helpers/default_hw_info.inl" #include "shared/test/common/helpers/ult_hw_config.inl" #include "shared/test/common/helpers/variable_backup.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/custom_event_listener.h" #include "opencl/test/unit_test/linux/drm_wrap.h" #include "opencl/test/unit_test/linux/mock_os_layer.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h" #include "test.h" diff --git a/opencl/test/unit_test/linux/os_interface_linux_tests.cpp b/opencl/test/unit_test/linux/os_interface_linux_tests.cpp index 42f506f573..9d8402d777 100644 --- a/opencl/test/unit_test/linux/os_interface_linux_tests.cpp +++ b/opencl/test/unit_test/linux/os_interface_linux_tests.cpp @@ -9,8 +9,8 @@ #include "shared/source/os_interface/os_interface.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/helpers/variable_backup.h" +#include "shared/test/common/mocks/mock_execution_environment.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/os_interface/linux/drm_mock.h" #include "test.h" diff --git a/opencl/test/unit_test/mem_obj/buffer_pin_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_pin_tests.cpp index 7dad359fc1..01760802b9 100644 --- a/opencl/test/unit_test/mem_obj/buffer_pin_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_pin_tests.cpp @@ -6,13 +6,13 @@ */ #include "shared/source/memory_manager/os_agnostic_memory_manager.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" #include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/fixtures/platform_fixture.h" #include "opencl/test/unit_test/mocks/mock_context.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" #include "test.h" diff --git a/opencl/test/unit_test/mem_obj/buffer_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_tests.cpp index c1b7510673..e504c7c154 100644 --- a/opencl/test/unit_test/mem_obj/buffer_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_tests.cpp @@ -13,6 +13,7 @@ #include "shared/test/common/helpers/ult_hw_config.h" #include "shared/test/common/helpers/unit_test_helper.h" #include "shared/test/common/mocks/mock_device.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/ult_device_factory.h" #include "opencl/extensions/public/cl_ext_private.h" @@ -24,7 +25,6 @@ #include "opencl/test/unit_test/mocks/mock_allocation_properties.h" #include "opencl/test/unit_test/mocks/mock_buffer.h" #include "opencl/test/unit_test/mocks/mock_command_queue.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_gmm.h" #include "test.h" diff --git a/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.inl b/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.inl index 648cf22175..d8a8b0568e 100644 --- a/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.inl +++ b/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.inl @@ -8,11 +8,11 @@ #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/memory_manager/os_agnostic_memory_manager.h" #include "shared/test/common/mocks/mock_device.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/ult_device_factory.h" #include "opencl/source/helpers/memory_properties_helpers.h" #include "opencl/source/mem_obj/mem_obj_helper.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" #include "test.h" diff --git a/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.inl b/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.inl index 8a39e871bc..0df414a0ac 100644 --- a/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.inl +++ b/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.inl @@ -10,10 +10,10 @@ #include "shared/source/memory_manager/os_agnostic_memory_manager.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/unit_test_helper.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/mock_graphics_allocation.h" #include "opencl/test/unit_test/mocks/mock_allocation_properties.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" #include "opencl/test/unit_test/mocks/mock_os_context.h" #include "test.h" diff --git a/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp b/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp index ba1f541d74..f193c68289 100644 --- a/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp +++ b/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp @@ -20,6 +20,7 @@ #include "shared/test/common/mocks/mock_deferrable_deletion.h" #include "shared/test/common/mocks/mock_deferred_deleter.h" #include "shared/test/common/mocks/mock_device.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/mock_gfx_partition.h" #include "shared/test/common/mocks/mock_graphics_allocation.h" #include "shared/test/unit_test/compiler_interface/linker_mock.h" @@ -41,7 +42,6 @@ #include "opencl/test/unit_test/mocks/mock_allocation_properties.h" #include "opencl/test/unit_test/mocks/mock_context.h" #include "opencl/test/unit_test/mocks/mock_csr.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_gmm.h" #include "opencl/test/unit_test/mocks/mock_kernel.h" #include "opencl/test/unit_test/mocks/mock_mdi.h" diff --git a/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp b/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp index 1f1f9d49da..5e591a482d 100644 --- a/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp +++ b/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp @@ -9,6 +9,7 @@ #include "shared/source/memory_manager/allocations_list.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/mocks/mock_device.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/mock_graphics_allocation.h" #include "shared/test/common/mocks/ult_device_factory.h" #include "shared/test/unit_test/page_fault_manager/cpu_page_fault_manager_tests_fixture.h" @@ -20,7 +21,6 @@ #include "opencl/test/unit_test/mocks/mock_buffer.h" #include "opencl/test/unit_test/mocks/mock_command_queue.h" #include "opencl/test/unit_test/mocks/mock_context.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" #include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/mocks/mock_svm_manager.h" diff --git a/opencl/test/unit_test/mocks/CMakeLists.txt b/opencl/test/unit_test/mocks/CMakeLists.txt index 901df38294..4fd618cf33 100644 --- a/opencl/test/unit_test/mocks/CMakeLists.txt +++ b/opencl/test/unit_test/mocks/CMakeLists.txt @@ -9,9 +9,7 @@ set(IGDRCL_SRCS_tests_mocks ${CMAKE_CURRENT_SOURCE_DIR}/mock_allocation_properties.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_async_event_handler.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mock_async_event_handler.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_aub_center.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_aub_csr.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_aub_file_stream.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_aub_stream.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_aub_subcapture_manager.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_block_kernel_manager.h @@ -28,7 +26,6 @@ set(IGDRCL_SRCS_tests_mocks ${CMAKE_CURRENT_SOURCE_DIR}/mock_csr_simulated_common_hw.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_device_queue.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_event.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_execution_environment.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_gmm.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_gmm_page_table_mngr.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mock_gmm_page_table_mngr.h @@ -37,7 +34,6 @@ set(IGDRCL_SRCS_tests_mocks ${CMAKE_CURRENT_SOURCE_DIR}/mock_host_ptr_manager.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_image.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_internal_allocation_storage.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_io_functions.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_kernel.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mock_kernel.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_kernel_info.cpp @@ -74,15 +70,9 @@ if(WIN32) ${CMAKE_CURRENT_SOURCE_DIR}/mock_gmm_memory_base.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mock_gmm_memory_base.h ${CMAKE_CURRENT_SOURCE_DIR}/gmm_memory${BRANCH_DIR_SUFFIX}/mock_gmm_memory.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_wddm_interface20.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_wddm_interface23.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_wddm.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_wddm.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/mock_wddm_residency_allocations_container.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_wddm_residency_logger.h - ${CMAKE_CURRENT_SOURCE_DIR}/wddm_mock_helpers.h + ${NEO_SHARED_TEST_DIRECTORY}/unit_test/os_interface/windows/mock_gdi_interface.cpp ${IGDRCL_SRC_tests_mock_wddm} - ${NEO_SOURCE_DIR}/shared/test/unit_test/os_interface/windows/mock_gdi_interface.cpp ) else() list(APPEND IGDRCL_SRCS_tests_mocks diff --git a/opencl/test/unit_test/mocks/mock_memory_manager.h b/opencl/test/unit_test/mocks/mock_memory_manager.h index c2dd948264..0e4abcdf96 100644 --- a/opencl/test/unit_test/mocks/mock_memory_manager.h +++ b/opencl/test/unit_test/mocks/mock_memory_manager.h @@ -9,8 +9,8 @@ #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/memory_manager/os_agnostic_memory_manager.h" #include "shared/test/common/helpers/default_hw_info.h" +#include "shared/test/common/mocks/mock_execution_environment.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_host_ptr_manager.h" #include "gmock/gmock.h" diff --git a/opencl/test/unit_test/mt_tests/os_interface/linux/drm_memory_manager_mt_tests.cpp b/opencl/test/unit_test/mt_tests/os_interface/linux/drm_memory_manager_mt_tests.cpp index 9bc789205a..9bb9d1d90b 100644 --- a/opencl/test/unit_test/mt_tests/os_interface/linux/drm_memory_manager_mt_tests.cpp +++ b/opencl/test/unit_test/mt_tests/os_interface/linux/drm_memory_manager_mt_tests.cpp @@ -10,8 +10,8 @@ #include "shared/source/os_interface/linux/drm_memory_operations_handler.h" #include "shared/source/os_interface/os_interface.h" #include "shared/test/common/mocks/linux/mock_drm_memory_manager.h" +#include "shared/test/common/mocks/mock_execution_environment.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/os_interface/device_factory_tests.cpp b/opencl/test/unit_test/os_interface/device_factory_tests.cpp index bb0db67992..4285b31a5a 100644 --- a/opencl/test/unit_test/os_interface/device_factory_tests.cpp +++ b/opencl/test/unit_test/os_interface/device_factory_tests.cpp @@ -14,10 +14,10 @@ #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/ult_hw_config.h" #include "shared/test/common/helpers/variable_backup.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/ult_device_factory.h" #include "opencl/source/platform/platform.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" #include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" diff --git a/opencl/test/unit_test/os_interface/linux/debug_env_reader.cpp b/opencl/test/unit_test/os_interface/linux/debug_env_reader.cpp index e58027a751..688f85eb6f 100644 --- a/opencl/test/unit_test/os_interface/linux/debug_env_reader.cpp +++ b/opencl/test/unit_test/os_interface/linux/debug_env_reader.cpp @@ -8,8 +8,8 @@ #include "shared/source/os_interface/debug_env_reader.h" #include "shared/test/common/helpers/variable_backup.h" +#include "shared/test/common/mocks/mock_io_functions.h" -#include "opencl/test/unit_test/mocks/mock_io_functions.h" #include "test.h" #include diff --git a/opencl/test/unit_test/os_interface/linux/device_command_stream_tests.cpp b/opencl/test/unit_test/os_interface/linux/device_command_stream_tests.cpp index 72296e50d2..4cea122255 100644 --- a/opencl/test/unit_test/os_interface/linux/device_command_stream_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/device_command_stream_tests.cpp @@ -5,18 +5,18 @@ * */ +#include "shared/source/command_stream/aub_command_stream_receiver.h" #include "shared/source/command_stream/command_stream_receiver.h" #include "shared/source/command_stream/device_command_stream.h" #include "shared/source/command_stream/linear_stream.h" #include "shared/source/os_interface/linux/drm_neo.h" #include "shared/source/os_interface/os_interface.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/unit_test/fixtures/mock_aub_center_fixture.h" -#include "opencl/source/command_stream/aub_command_stream_receiver.h" #include "opencl/source/os_interface/linux/device_command_stream.inl" #include "opencl/source/os_interface/linux/drm_command_stream.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" -#include "opencl/test/unit_test/fixtures/mock_aub_center_fixture.h" #include "opencl/test/unit_test/helpers/execution_environment_helper.h" #include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h" #include "test.h" diff --git a/opencl/test/unit_test/os_interface/linux/device_factory_tests.h b/opencl/test/unit_test/os_interface/linux/device_factory_tests.h index 5887205a06..a3b279ad20 100644 --- a/opencl/test/unit_test/os_interface/linux/device_factory_tests.h +++ b/opencl/test/unit_test/os_interface/linux/device_factory_tests.h @@ -11,8 +11,8 @@ #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/os_interface/device_factory.h" #include "shared/test/common/helpers/variable_backup.h" +#include "shared/test/common/mocks/mock_execution_environment.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/os_interface/linux/drm_mock.h" #include "test.h" diff --git a/opencl/test/unit_test/os_interface/linux/drm_command_stream_fixture.h b/opencl/test/unit_test/os_interface/linux/drm_command_stream_fixture.h index 7e4c260f2a..ce1624e798 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_command_stream_fixture.h +++ b/opencl/test/unit_test/os_interface/linux/drm_command_stream_fixture.h @@ -11,11 +11,11 @@ #include "shared/source/os_interface/linux/os_context_linux.h" #include "shared/source/os_interface/os_interface.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "opencl/source/os_interface/linux/drm_command_stream.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" #include "opencl/test/unit_test/mocks/linux/mock_drm_command_stream_receiver.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h" #include "test.h" diff --git a/opencl/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp index f395a121d1..d772c96231 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp @@ -11,10 +11,10 @@ #include "shared/source/os_interface/os_interface.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/mocks/linux/mock_drm_memory_manager.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "opencl/source/os_interface/linux/drm_command_stream.h" #include "opencl/source/platform/platform.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h" #include "test.h" diff --git a/opencl/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp index 50ad8750e9..7bda6dfdc8 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp @@ -13,10 +13,10 @@ #include "shared/source/os_interface/linux/drm_memory_manager.h" #include "shared/source/os_interface/linux/drm_memory_operations_handler.h" #include "shared/source/os_interface/os_interface.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/source/os_interface/linux/drm_command_stream.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h" #include "test.h" diff --git a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_allocate_in_device_pool_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_allocate_in_device_pool_tests.cpp index cb45c317c0..74731139ac 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_allocate_in_device_pool_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_allocate_in_device_pool_tests.cpp @@ -11,10 +11,10 @@ #include "shared/source/os_interface/os_interface.h" #include "shared/test/common/helpers/ult_hw_config.h" #include "shared/test/common/mocks/linux/mock_drm_memory_manager.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_allocation_properties.h" #include "opencl/test/unit_test/mocks/mock_context.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/os_interface/linux/drm_command_stream_fixture.h" #include "opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.h" #include "test.h" diff --git a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_allocate_in_device_pool_tests_dg1.cpp b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_allocate_in_device_pool_tests_dg1.cpp index 0e2aac7331..47f19cfa6a 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_allocate_in_device_pool_tests_dg1.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_allocate_in_device_pool_tests_dg1.cpp @@ -14,8 +14,8 @@ #include "shared/source/os_interface/os_interface.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/mocks/linux/mock_drm_memory_manager.h" +#include "shared/test/common/mocks/mock_execution_environment.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_gmm.h" #include "opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests_dg1.h" #include "opencl/test/unit_test/os_interface/linux/drm_mock_dg1.h" diff --git a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.h b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.h index f3cdd1a447..d6fd0ee72c 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.h +++ b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.h @@ -13,12 +13,12 @@ #include "shared/test/common/helpers/variable_backup.h" #include "shared/test/common/mocks/linux/mock_drm_memory_manager.h" #include "shared/test/common/mocks/mock_device.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/mocks/linux/mock_drm_command_stream_receiver.h" #include "opencl/test/unit_test/mocks/mock_builtins.h" #include "opencl/test/unit_test/mocks/mock_cl_device.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h" #include diff --git a/opencl/test/unit_test/os_interface/linux/os_interface_linux_tests.cpp b/opencl/test/unit_test/os_interface/linux/os_interface_linux_tests.cpp index 0b79587e7b..e6ee5ae2aa 100644 --- a/opencl/test/unit_test/os_interface/linux/os_interface_linux_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/os_interface_linux_tests.cpp @@ -10,8 +10,8 @@ #include "shared/source/helpers/hw_helper.h" #include "shared/source/os_interface/linux/os_context_linux.h" #include "shared/source/os_interface/os_interface.h" +#include "shared/test/common/mocks/mock_execution_environment.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/os_interface/linux/drm_mock.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/os_interface/mock_performance_counters.cpp b/opencl/test/unit_test/os_interface/mock_performance_counters.cpp index af0c93b871..744c0b3f9a 100644 --- a/opencl/test/unit_test/os_interface/mock_performance_counters.cpp +++ b/opencl/test/unit_test/os_interface/mock_performance_counters.cpp @@ -9,8 +9,7 @@ #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/os_interface/os_interface.h" - -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" +#include "shared/test/common/mocks/mock_execution_environment.h" using namespace MetricsLibraryApi; namespace NEO { diff --git a/opencl/test/unit_test/os_interface/performance_counters_tests.cpp b/opencl/test/unit_test/os_interface/performance_counters_tests.cpp index 83d9f1db2c..386592f92e 100644 --- a/opencl/test/unit_test/os_interface/performance_counters_tests.cpp +++ b/opencl/test/unit_test/os_interface/performance_counters_tests.cpp @@ -11,10 +11,10 @@ #include "shared/source/utilities/tag_allocator.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/mocks/mock_device.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/fixtures/device_instrumentation_fixture.h" #include "opencl/test/unit_test/mocks/mock_cl_device.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_os_context.h" #include "opencl/test/unit_test/os_interface/mock_performance_counters.h" diff --git a/opencl/test/unit_test/os_interface/windows/CMakeLists.txt b/opencl/test/unit_test/os_interface/windows/CMakeLists.txt index 21c6c69bf6..b78b54ebbf 100644 --- a/opencl/test/unit_test/os_interface/windows/CMakeLists.txt +++ b/opencl/test/unit_test/os_interface/windows/CMakeLists.txt @@ -11,7 +11,6 @@ set(IGDRCL_SRCS_tests_os_interface_windows ${CMAKE_CURRENT_SOURCE_DIR}/device_os_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/driver_info_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/file_logger_win_tests.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/gdi_dll_fixture.h ${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_win_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_win_tests.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_environment_variables.h @@ -30,7 +29,6 @@ set(IGDRCL_SRCS_tests_os_interface_windows ${CMAKE_CURRENT_SOURCE_DIR}/registry_reader_tests.h ${CMAKE_CURRENT_SOURCE_DIR}/self_lib_win.cpp ${CMAKE_CURRENT_SOURCE_DIR}/wddm_address_space_tests.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/wddm_fixture.h ${CMAKE_CURRENT_SOURCE_DIR}/wddm_kmdaf_listener_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/wddm_memory_manager_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/wddm_memory_manager_tests.h @@ -42,6 +40,7 @@ set(IGDRCL_SRCS_tests_os_interface_windows ${CMAKE_CURRENT_SOURCE_DIR}/mock_registry_reader.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mock_sys_calls.h ) + if(WIN32) file(GLOB IGDRCL_SRC_tests_wddm_interface "${CMAKE_CURRENT_SOURCE_DIR}/wddm2[0-9]_tests\.cpp") target_sources(igdrcl_tests PRIVATE @@ -49,4 +48,5 @@ if(WIN32) ${IGDRCL_SRC_tests_wddm_interface} ) endif() + add_subdirectories() diff --git a/opencl/test/unit_test/os_interface/windows/deferrable_deletion_win_tests.cpp b/opencl/test/unit_test/os_interface/windows/deferrable_deletion_win_tests.cpp index 0bde7fd235..4a713936a4 100644 --- a/opencl/test/unit_test/os_interface/windows/deferrable_deletion_win_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/deferrable_deletion_win_tests.cpp @@ -7,9 +7,8 @@ #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/os_interface/windows/deferrable_deletion_win.h" - -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" -#include "opencl/test/unit_test/mocks/mock_wddm.h" +#include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/mocks/mock_wddm.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp b/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp index 004a790491..4d85619844 100644 --- a/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp @@ -5,6 +5,7 @@ * */ +#include "shared/source/command_stream/aub_command_stream_receiver.h" #include "shared/source/command_stream/command_stream_receiver.h" #include "shared/source/command_stream/device_command_stream.h" #include "shared/source/command_stream/linear_stream.h" @@ -20,32 +21,32 @@ #include "shared/source/os_interface/windows/wddm_memory_manager.h" #include "shared/source/os_interface/windows/wddm_memory_operations_handler.h" #include "shared/source/os_interface/windows/wddm_residency_controller.h" +#include "shared/test/common/fixtures/device_fixture.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/dispatch_flags_helper.h" #include "shared/test/common/mocks/mock_device.h" #include "shared/test/common/mocks/mock_graphics_allocation.h" +#include "shared/test/common/mocks/mock_io_functions.h" #include "shared/test/common/mocks/windows/mock_wddm_direct_submission.h" +#include "shared/test/common/os_interface/windows/wddm_fixture.h" +#include "shared/test/unit_test/fixtures/mock_aub_center_fixture.h" #include "shared/test/unit_test/os_interface/windows/mock_gdi_interface.h" -#include "opencl/source/command_stream/aub_command_stream_receiver.h" #include "opencl/source/command_stream/command_stream_receiver_with_aub_dump.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/source/os_interface/windows/wddm_device_command_stream.h" #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" #include "opencl/test/unit_test/fixtures/memory_management_fixture.h" -#include "opencl/test/unit_test/fixtures/mock_aub_center_fixture.h" #include "opencl/test/unit_test/helpers/execution_environment_helper.h" #include "opencl/test/unit_test/mocks/mock_buffer.h" #include "opencl/test/unit_test/mocks/mock_builtins.h" #include "opencl/test/unit_test/mocks/mock_gmm_page_table_mngr.h" -#include "opencl/test/unit_test/mocks/mock_io_functions.h" #include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/mocks/mock_program.h" #include "opencl/test/unit_test/mocks/mock_submissions_aggregator.h" #include "opencl/test/unit_test/mocks/mock_wddm_interface23.h" #include "opencl/test/unit_test/os_interface/windows/mock_wddm_memory_manager.h" -#include "opencl/test/unit_test/os_interface/windows/wddm_fixture.h" #include "test.h" #include "hw_cmds.h" @@ -176,10 +177,20 @@ class WddmCommandStreamWithMockGdiFixture { using WddmCommandStreamTest = ::Test; using WddmCommandStreamMockGdiTest = ::Test; using WddmDefaultTest = ::Test; -using DeviceCommandStreamTest = ::Test; +struct DeviceCommandStreamTest : ::Test, DeviceFixture { + void SetUp() override { + DeviceFixture::SetUp(); + MockAubCenterFixture::SetUp(); + setMockAubCenter(pDevice->getRootDeviceEnvironmentRef()); + } + void TearDown() override { + MockAubCenterFixture::TearDown(); + DeviceFixture::TearDown(); + } +}; TEST_F(DeviceCommandStreamTest, WhenCreatingWddmCsrThenWddmPointerIsSetCorrectly) { - ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment(); + ExecutionEnvironment *executionEnvironment = pDevice->getExecutionEnvironment(); auto wddm = Wddm::createWddm(nullptr, *executionEnvironment->rootDeviceEnvironments[0].get()); executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique(); executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(wddm)); @@ -191,7 +202,7 @@ TEST_F(DeviceCommandStreamTest, WhenCreatingWddmCsrThenWddmPointerIsSetCorrectly } TEST_F(DeviceCommandStreamTest, WhenCreatingWddmCsrWithAubDumpThenAubCsrIsCreated) { - ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment(); + ExecutionEnvironment *executionEnvironment = pDevice->getExecutionEnvironment(); auto wddm = Wddm::createWddm(nullptr, *executionEnvironment->rootDeviceEnvironments[0].get()); executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique(); executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(wddm)); diff --git a/opencl/test/unit_test/os_interface/windows/driver_info_tests.cpp b/opencl/test/unit_test/os_interface/windows/driver_info_tests.cpp index 1cd354f0c5..6d5aad988b 100644 --- a/opencl/test/unit_test/os_interface/windows/driver_info_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/driver_info_tests.cpp @@ -15,11 +15,11 @@ #include "shared/test/common/helpers/ult_hw_config.h" #include "shared/test/common/helpers/variable_backup.h" #include "shared/test/common/mocks/mock_device.h" +#include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/mocks/mock_wddm.h" #include "opencl/test/unit_test/mocks/mock_cl_device.h" #include "opencl/test/unit_test/mocks/mock_csr.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" -#include "opencl/test/unit_test/mocks/mock_wddm.h" #include "opencl/test/unit_test/os_interface/windows/registry_reader_tests.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/os_interface/windows/file_logger_win_tests.cpp b/opencl/test/unit_test/os_interface/windows/file_logger_win_tests.cpp index 4fb891c7ac..c3b4151b00 100644 --- a/opencl/test/unit_test/os_interface/windows/file_logger_win_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/file_logger_win_tests.cpp @@ -7,9 +7,9 @@ #include "shared/source/debug_settings/debug_settings_manager.h" #include "shared/source/gmm_helper/gmm.h" +#include "shared/test/common/fixtures/mock_execution_environment_gmm_fixture.h" +#include "shared/test/common/mocks/mock_execution_environment.h" -#include "opencl/test/unit_test/fixtures/mock_execution_environment_gmm_fixture.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/os_interface/windows/mock_wddm_allocation.h" #include "opencl/test/unit_test/utilities/file_logger_tests.h" #include "test.h" diff --git a/opencl/test/unit_test/os_interface/windows/gl/cl_get_gl_context_info_khr_tests.cpp b/opencl/test/unit_test/os_interface/windows/gl/cl_get_gl_context_info_khr_tests.cpp index 93de2ce94b..e18be4b4ff 100644 --- a/opencl/test/unit_test/os_interface/windows/gl/cl_get_gl_context_info_khr_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/gl/cl_get_gl_context_info_khr_tests.cpp @@ -9,11 +9,11 @@ #include "shared/source/os_interface/device_factory.h" #include "shared/source/os_interface/os_interface.h" #include "shared/test/common/mocks/mock_device.h" +#include "shared/test/common/mocks/mock_wddm.h" #include "opencl/source/cl_device/cl_device.h" #include "opencl/test/unit_test/api/cl_api_tests.h" #include "opencl/test/unit_test/mocks/mock_platform.h" -#include "opencl/test/unit_test/mocks/mock_wddm.h" #include "opencl/test/unit_test/sharings/gl/gl_dll_helper.h" using namespace NEO; diff --git a/opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp b/opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp index de5766ba8b..34947d9fbe 100644 --- a/opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp @@ -12,8 +12,8 @@ #include "shared/source/os_interface/os_interface.h" #include "shared/source/os_interface/windows/wddm/wddm.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/mocks/mock_execution_environment.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "test.h" namespace NEO { diff --git a/opencl/test/unit_test/os_interface/windows/mock_performance_counters_win.cpp b/opencl/test/unit_test/os_interface/windows/mock_performance_counters_win.cpp index b044ce08b6..ec13bffab2 100644 --- a/opencl/test/unit_test/os_interface/windows/mock_performance_counters_win.cpp +++ b/opencl/test/unit_test/os_interface/windows/mock_performance_counters_win.cpp @@ -9,8 +9,8 @@ #include "shared/source/os_interface/os_interface.h" #include "shared/source/os_interface/windows/windows_wrapper.h" +#include "shared/test/common/mocks/mock_wddm.h" -#include "opencl/test/unit_test/mocks/mock_wddm.h" #include "opencl/test/unit_test/os_interface/windows/mock_os_time_win.h" namespace NEO { diff --git a/opencl/test/unit_test/os_interface/windows/os_context_win_tests.cpp b/opencl/test/unit_test/os_interface/windows/os_context_win_tests.cpp index 47e3ab43aa..f90508c4af 100644 --- a/opencl/test/unit_test/os_interface/windows/os_context_win_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/os_context_win_tests.cpp @@ -6,9 +6,8 @@ */ #include "shared/test/common/helpers/debug_manager_state_restore.h" - -#include "opencl/test/unit_test/mocks/mock_wddm.h" -#include "opencl/test/unit_test/os_interface/windows/wddm_fixture.h" +#include "shared/test/common/mocks/mock_wddm.h" +#include "shared/test/common/os_interface/windows/wddm_fixture.h" using namespace NEO; diff --git a/opencl/test/unit_test/os_interface/windows/os_interface_win_tests.cpp b/opencl/test/unit_test/os_interface/windows/os_interface_win_tests.cpp index dd97fda1a3..46ed2c3d29 100644 --- a/opencl/test/unit_test/os_interface/windows/os_interface_win_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/os_interface_win_tests.cpp @@ -10,9 +10,8 @@ #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/os_interface/windows/os_context_win.h" #include "shared/source/os_interface/windows/sys_calls.h" - -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" -#include "opencl/test/unit_test/os_interface/windows/wddm_fixture.h" +#include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/os_interface/windows/wddm_fixture.h" TEST_F(OsInterfaceTest, GivenWindowsWhenOsSupportFor64KBpagesIsBeingQueriedThenTrueIsReturned) { EXPECT_TRUE(OSInterface::are64kbPagesEnabled()); diff --git a/opencl/test/unit_test/os_interface/windows/os_time_win_tests.cpp b/opencl/test/unit_test/os_interface/windows/os_time_win_tests.cpp index a70f499973..01b67100e7 100644 --- a/opencl/test/unit_test/os_interface/windows/os_time_win_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/os_time_win_tests.cpp @@ -7,9 +7,8 @@ #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/os_interface/os_interface.h" - -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" -#include "opencl/test/unit_test/os_interface/windows/wddm_fixture.h" +#include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/os_interface/windows/wddm_fixture.h" #include "gtest/gtest.h" #include "mock_os_time_win.h" diff --git a/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp index 1213cacc29..6102a6a85d 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp @@ -24,16 +24,16 @@ #include "shared/source/os_interface/windows/wddm_memory_manager.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/variable_backup.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/mock_gfx_partition.h" +#include "shared/test/common/mocks/mock_io_functions.h" +#include "shared/test/common/mocks/mock_wddm_residency_logger.h" +#include "shared/test/common/os_interface/windows/wddm_fixture.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_gmm_resource_info.h" -#include "opencl/test/unit_test/mocks/mock_io_functions.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" -#include "opencl/test/unit_test/mocks/mock_wddm_residency_logger.h" #include "opencl/test/unit_test/os_interface/windows/mock_wddm_allocation.h" #include "opencl/test/unit_test/os_interface/windows/ult_dxcore_factory.h" -#include "opencl/test/unit_test/os_interface/windows/wddm_fixture.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/os_interface/windows/wddm23_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm23_tests.cpp index 940aca56ed..da07fcbd70 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm23_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm23_tests.cpp @@ -14,12 +14,12 @@ #include "shared/source/os_interface/windows/gdi_interface.h" #include "shared/source/os_interface/windows/os_context_win.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/mocks/mock_wddm.h" +#include "shared/test/common/os_interface/windows/gdi_dll_fixture.h" #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/mocks/mock_platform.h" -#include "opencl/test/unit_test/mocks/mock_wddm.h" #include "opencl/test/unit_test/mocks/mock_wddm_interface23.h" -#include "opencl/test/unit_test/os_interface/windows/gdi_dll_fixture.h" #include "test.h" using namespace NEO; diff --git a/opencl/test/unit_test/os_interface/windows/wddm_address_space_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm_address_space_tests.cpp index 4447325751..99da845820 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_address_space_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_address_space_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -7,9 +7,9 @@ #include "shared/source/command_stream/preemption.h" #include "shared/source/execution_environment/root_device_environment.h" +#include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/mocks/mock_wddm.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" -#include "opencl/test/unit_test/mocks/mock_wddm.h" #include "test.h" using namespace NEO; diff --git a/opencl/test/unit_test/os_interface/windows/wddm_calls.cpp b/opencl/test/unit_test/os_interface/windows/wddm_calls.cpp index 1564ed8a73..2c8fa47389 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_calls.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_calls.cpp @@ -6,8 +6,8 @@ */ #include "shared/source/memory_manager/host_ptr_defines.h" +#include "shared/test/common/mocks/mock_wddm.h" -#include "opencl/test/unit_test/mocks/mock_wddm.h" #include "opencl/test/unit_test/os_interface/windows/ult_dxcore_factory.h" #include "opencl/test/unit_test/os_interface/windows/ult_dxgi_factory.h" diff --git a/opencl/test/unit_test/os_interface/windows/wddm_create.cpp b/opencl/test/unit_test/os_interface/windows/wddm_create.cpp index ad5e2ec6a6..4a5b221939 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_create.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_create.cpp @@ -5,7 +5,7 @@ * */ -#include "opencl/test/unit_test/mocks/mock_wddm.h" +#include "shared/test/common/mocks/mock_wddm.h" namespace NEO { Wddm *Wddm::createWddm(std::unique_ptr hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) { diff --git a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.h b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.h index 7c0c1b5f8e..29d0d1e91a 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.h +++ b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.h @@ -10,6 +10,8 @@ #include "shared/source/os_interface/os_interface.h" #include "shared/source/os_interface/windows/os_environment_win.h" #include "shared/source/os_interface/windows/wddm_memory_operations_handler.h" +#include "shared/test/common/mocks/mock_wddm_residency_allocations_container.h" +#include "shared/test/common/os_interface/windows/wddm_fixture.h" #include "shared/test/unit_test/os_interface/windows/mock_gdi_interface.h" #include "opencl/test/unit_test/helpers/execution_environment_helper.h" @@ -17,9 +19,7 @@ #include "opencl/test/unit_test/mocks/mock_gmm.h" #include "opencl/test/unit_test/mocks/mock_gmm_page_table_mngr.h" #include "opencl/test/unit_test/mocks/mock_platform.h" -#include "opencl/test/unit_test/mocks/mock_wddm_residency_allocations_container.h" #include "opencl/test/unit_test/os_interface/windows/mock_wddm_memory_manager.h" -#include "opencl/test/unit_test/os_interface/windows/wddm_fixture.h" #include "test.h" #include "gmock/gmock.h" diff --git a/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp index 0053ae9896..4dc7b2b18f 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp @@ -17,14 +17,14 @@ #include "shared/source/os_interface/windows/wddm/wddm_interface.h" #include "shared/source/os_interface/windows/wddm_memory_operations_handler.h" #include "shared/source/os_interface/windows/wddm_residency_controller.h" +#include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/mocks/mock_wddm.h" #include "shared/test/unit_test/os_interface/windows/mock_gdi_interface.h" #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/libult/create_command_stream.h" #include "opencl/test/unit_test/mocks/mock_allocation_properties.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_platform.h" -#include "opencl/test/unit_test/mocks/mock_wddm.h" #include "opencl/test/unit_test/os_interface/windows/mock_wddm_allocation.h" #include "opencl/test/unit_test/os_interface/windows/mock_wddm_memory_manager.h" #include "test.h" diff --git a/opencl/test/unit_test/os_interface/windows/wddm_residency_handler_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm_residency_handler_tests.cpp index 8b2175e2f7..b49040a8b9 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_residency_handler_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_residency_handler_tests.cpp @@ -11,14 +11,14 @@ #include "shared/test/common/helpers/ult_hw_config.h" #include "shared/test/common/helpers/variable_backup.h" #include "shared/test/common/mocks/mock_device.h" +#include "shared/test/common/mocks/mock_wddm.h" +#include "shared/test/common/os_interface/windows/wddm_fixture.h" #include "opencl/source/cl_device/cl_device.h" #include "opencl/test/unit_test/mocks/mock_allocation_properties.h" #include "opencl/test/unit_test/mocks/mock_context.h" #include "opencl/test/unit_test/mocks/mock_platform.h" -#include "opencl/test/unit_test/mocks/mock_wddm.h" #include "opencl/test/unit_test/os_interface/windows/mock_wddm_allocation.h" -#include "opencl/test/unit_test/os_interface/windows/wddm_fixture.h" #include "test.h" using namespace NEO; diff --git a/opencl/test/unit_test/platform/platform_tests.cpp b/opencl/test/unit_test/platform/platform_tests.cpp index 4061be3db6..b5013a4c4c 100644 --- a/opencl/test/unit_test/platform/platform_tests.cpp +++ b/opencl/test/unit_test/platform/platform_tests.cpp @@ -13,17 +13,17 @@ #include "shared/test/common/helpers/ult_hw_config.h" #include "shared/test/common/helpers/variable_backup.h" #include "shared/test/common/mocks/mock_device.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/mock_sip.h" +#include "shared/test/unit_test/fixtures/mock_aub_center_fixture.h" #include "opencl/source/cl_device/cl_device.h" #include "opencl/source/platform/extensions.h" #include "opencl/source/sharings/sharing_factory.h" -#include "opencl/test/unit_test/fixtures/mock_aub_center_fixture.h" #include "opencl/test/unit_test/fixtures/platform_fixture.h" #include "opencl/test/unit_test/mocks/mock_builtins.h" #include "opencl/test/unit_test/mocks/mock_cl_device.h" #include "opencl/test/unit_test/mocks/mock_csr.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/mocks/mock_source_level_debugger.h" #include "opencl/test/unit_test/mocks/ult_cl_device_factory.h" diff --git a/opencl/test/unit_test/program/kernel_info_tests.cpp b/opencl/test/unit_test/program/kernel_info_tests.cpp index 6841103fa0..afdb29dcfc 100644 --- a/opencl/test/unit_test/program/kernel_info_tests.cpp +++ b/opencl/test/unit_test/program/kernel_info_tests.cpp @@ -7,12 +7,12 @@ #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/memory_manager/os_agnostic_memory_manager.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/mock_graphics_allocation.h" #include "shared/test/common/mocks/ult_device_factory.h" #include "opencl/source/program/kernel_info.h" #include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/program/program_data_tests.cpp b/opencl/test/unit_test/program/program_data_tests.cpp index 234952e8a2..55ec2f9d80 100644 --- a/opencl/test/unit_test/program/program_data_tests.cpp +++ b/opencl/test/unit_test/program/program_data_tests.cpp @@ -10,6 +10,7 @@ #include "shared/source/memory_manager/graphics_allocation.h" #include "shared/source/memory_manager/unified_memory_manager.h" #include "shared/source/program/program_info_from_patchtokens.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/unit_test/compiler_interface/linker_mock.h" #include "shared/test/unit_test/device_binary_format/patchtokens_tests.h" @@ -18,7 +19,6 @@ #include "opencl/test/unit_test/mocks/mock_buffer.h" #include "opencl/test/unit_test/mocks/mock_cl_device.h" #include "opencl/test/unit_test/mocks/mock_csr.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" #include "opencl/test/unit_test/mocks/mock_program.h" #include "opencl/test/unit_test/program/program_with_source.h" diff --git a/opencl/test/unit_test/sharings/gl/windows/gl_create_from_texture_tests.cpp b/opencl/test/unit_test/sharings/gl/windows/gl_create_from_texture_tests.cpp index 0d95936dc1..5011185aec 100644 --- a/opencl/test/unit_test/sharings/gl/windows/gl_create_from_texture_tests.cpp +++ b/opencl/test/unit_test/sharings/gl/windows/gl_create_from_texture_tests.cpp @@ -6,6 +6,7 @@ */ #include "shared/source/helpers/get_info.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "opencl/source/cl_device/cl_device.h" #include "opencl/source/helpers/gmm_types_converter.h" @@ -14,7 +15,6 @@ #include "opencl/test/unit_test/libult/ult_command_stream_receiver.h" #include "opencl/test/unit_test/mocks/gl/windows/mock_gl_sharing_windows.h" #include "opencl/test/unit_test/mocks/mock_context.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_gmm.h" #include "test.h" diff --git a/opencl/test/unit_test/sharings/gl/windows/gl_os_sharing_tests.cpp b/opencl/test/unit_test/sharings/gl/windows/gl_os_sharing_tests.cpp index 55f512d6c3..111fad8e11 100644 --- a/opencl/test/unit_test/sharings/gl/windows/gl_os_sharing_tests.cpp +++ b/opencl/test/unit_test/sharings/gl/windows/gl_os_sharing_tests.cpp @@ -11,15 +11,15 @@ #include "shared/source/os_interface/windows/os_context_win.h" #include "shared/source/os_interface/windows/wddm/wddm.h" #include "shared/source/os_interface/windows/wddm_memory_operations_handler.h" +#include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/os_interface/windows/wddm_fixture.h" #include "opencl/extensions/public/cl_gl_private_intel.h" #include "opencl/source/sharings/gl/gl_arb_sync_event.h" #include "opencl/source/sharings/gl/windows/gl_sharing_windows.h" #include "opencl/test/unit_test/mocks/gl/windows/mock_gl_sharing_windows.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_platform.h" #include "opencl/test/unit_test/os_interface/windows/mock_sys_calls.h" -#include "opencl/test/unit_test/os_interface/windows/wddm_fixture.h" #include "gtest/gtest.h" #include diff --git a/opencl/test/unit_test/windows/os_interface_tests.cpp b/opencl/test/unit_test/windows/os_interface_tests.cpp index 024c178518..b9917f7109 100644 --- a/opencl/test/unit_test/windows/os_interface_tests.cpp +++ b/opencl/test/unit_test/windows/os_interface_tests.cpp @@ -7,9 +7,9 @@ #include "shared/source/helpers/constants.h" #include "shared/source/os_interface/os_interface.h" +#include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/mocks/mock_wddm.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" -#include "opencl/test/unit_test/mocks/mock_wddm.h" #include "test.h" using namespace NEO; diff --git a/opencl/test/unit_test/windows/wddm_create_tests.cpp b/opencl/test/unit_test/windows/wddm_create_tests.cpp index 723d541ab2..4d197a20ac 100644 --- a/opencl/test/unit_test/windows/wddm_create_tests.cpp +++ b/opencl/test/unit_test/windows/wddm_create_tests.cpp @@ -10,8 +10,8 @@ #include "shared/source/os_interface/os_interface.h" #include "shared/source/os_interface/windows/wddm/wddm.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/mocks/mock_execution_environment.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "test.h" #include diff --git a/shared/source/command_stream/CMakeLists.txt b/shared/source/command_stream/CMakeLists.txt index 08f8c09c04..83e910e0cd 100644 --- a/shared/source/command_stream/CMakeLists.txt +++ b/shared/source/command_stream/CMakeLists.txt @@ -6,6 +6,8 @@ set(NEO_CORE_COMMAND_STREAM ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/aub_command_stream_receiver.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/aub_command_stream_receiver.h ${CMAKE_CURRENT_SOURCE_DIR}/aub_subcapture_status.h ${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver.cpp ${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver.h diff --git a/opencl/source/command_stream/aub_command_stream_receiver.cpp b/shared/source/command_stream/aub_command_stream_receiver.cpp similarity index 99% rename from opencl/source/command_stream/aub_command_stream_receiver.cpp rename to shared/source/command_stream/aub_command_stream_receiver.cpp index 0770bb4ae4..4869304744 100644 --- a/opencl/source/command_stream/aub_command_stream_receiver.cpp +++ b/shared/source/command_stream/aub_command_stream_receiver.cpp @@ -5,7 +5,7 @@ * */ -#include "opencl/source/command_stream/aub_command_stream_receiver.h" +#include "shared/source/command_stream/aub_command_stream_receiver.h" #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" diff --git a/opencl/source/command_stream/aub_command_stream_receiver.h b/shared/source/command_stream/aub_command_stream_receiver.h similarity index 100% rename from opencl/source/command_stream/aub_command_stream_receiver.h rename to shared/source/command_stream/aub_command_stream_receiver.h diff --git a/shared/source/command_stream/tbx_command_stream_receiver_hw.inl b/shared/source/command_stream/tbx_command_stream_receiver_hw.inl index d3d2a7d0a9..ca5c386c49 100644 --- a/shared/source/command_stream/tbx_command_stream_receiver_hw.inl +++ b/shared/source/command_stream/tbx_command_stream_receiver_hw.inl @@ -10,6 +10,7 @@ #include "shared/source/aub_mem_dump/aub_alloc_dump.h" #include "shared/source/aub_mem_dump/aub_alloc_dump.inl" #include "shared/source/aub_mem_dump/page_table_entry_bits.h" +#include "shared/source/command_stream/aub_command_stream_receiver.h" #include "shared/source/debug_settings/debug_settings_manager.h" #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" @@ -25,7 +26,6 @@ #include "shared/source/memory_manager/physical_address_allocator.h" #include "shared/source/os_interface/os_context.h" -#include "opencl/source/command_stream/aub_command_stream_receiver.h" #include "opencl/source/command_stream/command_stream_receiver_with_aub_dump.h" #include "opencl/source/helpers/dispatch_info.h" #include "opencl/source/helpers/hardware_context_controller.h" diff --git a/shared/source/device/device.h b/shared/source/device/device.h index d86256ccb8..2c5fbb55b1 100644 --- a/shared/source/device/device.h +++ b/shared/source/device/device.h @@ -85,6 +85,7 @@ class Device : public ReferenceTrackedObject { ExecutionEnvironment *getExecutionEnvironment() const { return executionEnvironment; } const RootDeviceEnvironment &getRootDeviceEnvironment() const { return *executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]; } + RootDeviceEnvironment &getRootDeviceEnvironmentRef() const { return *executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]; } const HardwareCapabilities &getHardwareCapabilities() const { return hardwareCapabilities; } bool isFullRangeSvm() const { return getRootDeviceEnvironment().isFullRangeSvm(); diff --git a/shared/test/common/debug_settings/linux/debug_settings_manager_linux_tests.cpp b/shared/test/common/debug_settings/linux/debug_settings_manager_linux_tests.cpp index 551f6a784b..e6bb786e89 100644 --- a/shared/test/common/debug_settings/linux/debug_settings_manager_linux_tests.cpp +++ b/shared/test/common/debug_settings/linux/debug_settings_manager_linux_tests.cpp @@ -9,8 +9,8 @@ #include "shared/source/utilities/debug_file_reader.h" #include "shared/test/common/debug_settings/debug_settings_manager_fixture.h" #include "shared/test/common/helpers/variable_backup.h" +#include "shared/test/common/mocks/mock_io_functions.h" -#include "opencl/test/unit_test/mocks/mock_io_functions.h" #include "test.h" #include diff --git a/shared/test/common/debug_settings/linux/debug_variables_helper_linux_tests.cpp b/shared/test/common/debug_settings/linux/debug_variables_helper_linux_tests.cpp index 830c3ef7dd..bc96cc76d4 100644 --- a/shared/test/common/debug_settings/linux/debug_variables_helper_linux_tests.cpp +++ b/shared/test/common/debug_settings/linux/debug_variables_helper_linux_tests.cpp @@ -7,8 +7,8 @@ #include "shared/source/debug_settings/debug_variables_helper.h" #include "shared/test/common/helpers/variable_backup.h" +#include "shared/test/common/mocks/mock_io_functions.h" -#include "opencl/test/unit_test/mocks/mock_io_functions.h" #include "test.h" #include diff --git a/shared/test/common/fixtures/CMakeLists.txt b/shared/test/common/fixtures/CMakeLists.txt index 3e7448f60f..b09504c121 100644 --- a/shared/test/common/fixtures/CMakeLists.txt +++ b/shared/test/common/fixtures/CMakeLists.txt @@ -7,8 +7,6 @@ target_sources(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/command_container_fixture.h - ${CMAKE_CURRENT_SOURCE_DIR}/device_fixture.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/device_fixture.h ${CMAKE_CURRENT_SOURCE_DIR}/direct_submission_fixture.h ${CMAKE_CURRENT_SOURCE_DIR}/front_window_fixture.cpp ${CMAKE_CURRENT_SOURCE_DIR}/front_window_fixture.h diff --git a/opencl/test/unit_test/fixtures/mock_execution_environment_gmm_fixture.cpp b/shared/test/common/fixtures/mock_execution_environment_gmm_fixture.cpp similarity index 75% rename from opencl/test/unit_test/fixtures/mock_execution_environment_gmm_fixture.cpp rename to shared/test/common/fixtures/mock_execution_environment_gmm_fixture.cpp index 58f6718d1e..0f5dcd9b9e 100644 --- a/opencl/test/unit_test/fixtures/mock_execution_environment_gmm_fixture.cpp +++ b/shared/test/common/fixtures/mock_execution_environment_gmm_fixture.cpp @@ -1,13 +1,13 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2021 Intel Corporation * * SPDX-License-Identifier: MIT * */ -#include "opencl/test/unit_test/fixtures/mock_execution_environment_gmm_fixture.h" +#include "shared/test/common/fixtures/mock_execution_environment_gmm_fixture.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" +#include "shared/test/common/mocks/mock_execution_environment.h" namespace NEO { void MockExecutionEnvironmentGmmFixture::SetUp() { diff --git a/opencl/test/unit_test/fixtures/mock_execution_environment_gmm_fixture.h b/shared/test/common/fixtures/mock_execution_environment_gmm_fixture.h similarity index 87% rename from opencl/test/unit_test/fixtures/mock_execution_environment_gmm_fixture.h rename to shared/test/common/fixtures/mock_execution_environment_gmm_fixture.h index 75b8527878..f711e74210 100644 --- a/opencl/test/unit_test/fixtures/mock_execution_environment_gmm_fixture.h +++ b/shared/test/common/fixtures/mock_execution_environment_gmm_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * diff --git a/shared/test/common/libult/CMakeLists.txt b/shared/test/common/libult/CMakeLists.txt index 070e3178eb..30fe4545ef 100644 --- a/shared/test/common/libult/CMakeLists.txt +++ b/shared/test/common/libult/CMakeLists.txt @@ -34,6 +34,10 @@ endmacro() apply_macro_for_each_gen("TESTED") set(igdrcl_libult_common_SRCS_LIB_ULT + ${NEO_SHARED_TEST_DIRECTORY}/common/fixtures/device_fixture.cpp + ${NEO_SHARED_TEST_DIRECTORY}/common/fixtures/device_fixture.h + ${NEO_SHARED_TEST_DIRECTORY}/common/fixtures/mock_execution_environment_gmm_fixture.cpp + ${NEO_SHARED_TEST_DIRECTORY}/common/fixtures/mock_execution_environment_gmm_fixture.h ${NEO_SHARED_TEST_DIRECTORY}/common/helpers/memory_leak_listener.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/helpers/memory_leak_listener.h ${NEO_SHARED_TEST_DIRECTORY}/common/helpers/memory_management.cpp diff --git a/shared/test/common/mocks/CMakeLists.txt b/shared/test/common/mocks/CMakeLists.txt index d71144b5d1..cd2702aadb 100644 --- a/shared/test/common/mocks/CMakeLists.txt +++ b/shared/test/common/mocks/CMakeLists.txt @@ -15,6 +15,8 @@ set_property(GLOBAL PROPERTY NEO_CORE_tests_compiler_mocks ${NEO_CORE_tests_comp set(NEO_CORE_tests_mocks ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/mock_aub_center.h + ${CMAKE_CURRENT_SOURCE_DIR}/mock_aub_file_stream.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_aub_manager.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_bindless_heaps_helper.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_cif.cpp @@ -25,39 +27,47 @@ set(NEO_CORE_tests_mocks ${CMAKE_CURRENT_SOURCE_DIR}/mock_compiler_interface_spirv.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_compilers.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mock_compilers.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_direct_submission_hw.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_direct_submission_diagnostic_collector.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_dispatch_kernel_encoder_interface.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/mock_dispatch_kernel_encoder_interface.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_experimental_command_buffer.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_gmm_client_context_base.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/mock_gmm_client_context_base.h - ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/mock_gmm_client_context.cpp - ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/mock_gmm_client_context.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_debugger.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_device.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/mock_device.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_elf.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_graphics_allocation.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_gfx_partition.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/mock_gfx_partition.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_memory_operations_handler.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_os_library.h - ${CMAKE_CURRENT_SOURCE_DIR}/mock_sip.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/mock_sip.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_deferrable_deletion.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mock_deferrable_deletion.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_deferred_deleter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mock_deferred_deleter.h + ${CMAKE_CURRENT_SOURCE_DIR}/mock_device.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/mock_device.h + ${CMAKE_CURRENT_SOURCE_DIR}/mock_direct_submission_hw.h + ${CMAKE_CURRENT_SOURCE_DIR}/mock_direct_submission_diagnostic_collector.h + ${CMAKE_CURRENT_SOURCE_DIR}/mock_dispatch_kernel_encoder_interface.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/mock_dispatch_kernel_encoder_interface.h + ${CMAKE_CURRENT_SOURCE_DIR}/mock_elf.h + ${CMAKE_CURRENT_SOURCE_DIR}/mock_execution_environment.h + ${CMAKE_CURRENT_SOURCE_DIR}/mock_experimental_command_buffer.h + ${CMAKE_CURRENT_SOURCE_DIR}/mock_gfx_partition.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/mock_gfx_partition.h + ${CMAKE_CURRENT_SOURCE_DIR}/mock_gmm_client_context_base.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/mock_gmm_client_context_base.h + ${CMAKE_CURRENT_SOURCE_DIR}/mock_graphics_allocation.h + ${CMAKE_CURRENT_SOURCE_DIR}/mock_io_functions.h + ${CMAKE_CURRENT_SOURCE_DIR}/mock_memory_operations_handler.h + ${CMAKE_CURRENT_SOURCE_DIR}/mock_os_library.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_physical_address_allocator.h + ${CMAKE_CURRENT_SOURCE_DIR}/mock_sip.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/mock_sip.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_tbx_csr.h ${CMAKE_CURRENT_SOURCE_DIR}/mock_tbx_stream.h ${CMAKE_CURRENT_SOURCE_DIR}/ult_device_factory.cpp ${CMAKE_CURRENT_SOURCE_DIR}/ult_device_factory.h + ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/mock_gmm_client_context.cpp + ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/mock_gmm_client_context.h ) if(WIN32) list(APPEND NEO_CORE_tests_mocks + ${CMAKE_CURRENT_SOURCE_DIR}/mock_wddm.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/mock_wddm.h + ${CMAKE_CURRENT_SOURCE_DIR}/mock_wddm_interface20.h + ${CMAKE_CURRENT_SOURCE_DIR}/mock_wddm_residency_allocations_container.h + ${CMAKE_CURRENT_SOURCE_DIR}/mock_wddm_residency_logger.h + ${CMAKE_CURRENT_SOURCE_DIR}/wddm_mock_helpers.h ${CMAKE_CURRENT_SOURCE_DIR}/windows/mock_wddm_direct_submission.h ) else() diff --git a/opencl/test/unit_test/mocks/mock_aub_center.h b/shared/test/common/mocks/mock_aub_center.h similarity index 92% rename from opencl/test/unit_test/mocks/mock_aub_center.h rename to shared/test/common/mocks/mock_aub_center.h index e4f769ec5b..96c2ac7335 100644 --- a/opencl/test/unit_test/mocks/mock_aub_center.h +++ b/shared/test/common/mocks/mock_aub_center.h @@ -9,8 +9,7 @@ #include "shared/source/aub/aub_center.h" #include "shared/source/aub/aub_stream_provider.h" - -#include "opencl/test/unit_test/mocks/mock_aub_file_stream.h" +#include "shared/test/common/mocks/mock_aub_file_stream.h" namespace NEO { class MockAubStreamProvider : public AubStreamProvider { diff --git a/opencl/test/unit_test/mocks/mock_aub_file_stream.h b/shared/test/common/mocks/mock_aub_file_stream.h similarity index 97% rename from opencl/test/unit_test/mocks/mock_aub_file_stream.h rename to shared/test/common/mocks/mock_aub_file_stream.h index 52b7cf3fef..3f0aa91e16 100644 --- a/opencl/test/unit_test/mocks/mock_aub_file_stream.h +++ b/shared/test/common/mocks/mock_aub_file_stream.h @@ -7,7 +7,7 @@ #pragma once -#include "opencl/source/command_stream/aub_command_stream_receiver.h" +#include "shared/source/command_stream/aub_command_stream_receiver.h" #include "gmock/gmock.h" diff --git a/shared/test/common/mocks/mock_device.cpp b/shared/test/common/mocks/mock_device.cpp index 594817072b..c815d90748 100644 --- a/shared/test/common/mocks/mock_device.cpp +++ b/shared/test/common/mocks/mock_device.cpp @@ -10,10 +10,10 @@ #include "shared/source/command_stream/command_stream_receiver.h" #include "shared/source/command_stream/preemption.h" #include "shared/source/os_interface/os_context.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/ult_device_factory.h" #include "shared/test/unit_test/tests_configuration.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" #include "opencl/test/unit_test/mocks/mock_ostime.h" diff --git a/shared/test/common/mocks/mock_device.h b/shared/test/common/mocks/mock_device.h index d24e855e5b..b818a40abf 100644 --- a/shared/test/common/mocks/mock_device.h +++ b/shared/test/common/mocks/mock_device.h @@ -12,8 +12,7 @@ #include "shared/source/device/sub_device.h" #include "shared/source/memory_manager/memory_manager.h" #include "shared/test/common/helpers/variable_backup.h" - -#include "opencl/test/unit_test/fixtures/mock_aub_center_fixture.h" +#include "shared/test/unit_test/fixtures/mock_aub_center_fixture.h" namespace NEO { class CommandStreamReceiver; diff --git a/opencl/test/unit_test/mocks/mock_execution_environment.h b/shared/test/common/mocks/mock_execution_environment.h similarity index 95% rename from opencl/test/unit_test/mocks/mock_execution_environment.h rename to shared/test/common/mocks/mock_execution_environment.h index 613f56886b..10c9bb6992 100644 --- a/opencl/test/unit_test/mocks/mock_execution_environment.h +++ b/shared/test/common/mocks/mock_execution_environment.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -9,8 +9,7 @@ #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/helpers/hw_helper.h" - -#include "opencl/test/unit_test/fixtures/mock_aub_center_fixture.h" +#include "shared/test/unit_test/fixtures/mock_aub_center_fixture.h" namespace NEO { diff --git a/opencl/test/unit_test/mocks/mock_io_functions.h b/shared/test/common/mocks/mock_io_functions.h similarity index 100% rename from opencl/test/unit_test/mocks/mock_io_functions.h rename to shared/test/common/mocks/mock_io_functions.h diff --git a/shared/test/common/mocks/mock_sip.h b/shared/test/common/mocks/mock_sip.h index 6fe08a1d10..c50c1349df 100644 --- a/shared/test/common/mocks/mock_sip.h +++ b/shared/test/common/mocks/mock_sip.h @@ -8,8 +8,7 @@ #pragma once #include "shared/source/built_ins/sip.h" - -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include #include diff --git a/opencl/test/unit_test/mocks/mock_wddm.cpp b/shared/test/common/mocks/mock_wddm.cpp similarity index 98% rename from opencl/test/unit_test/mocks/mock_wddm.cpp rename to shared/test/common/mocks/mock_wddm.cpp index 475ff4e6b7..7dcfaf1b9d 100644 --- a/opencl/test/unit_test/mocks/mock_wddm.cpp +++ b/shared/test/common/mocks/mock_wddm.cpp @@ -5,7 +5,7 @@ * */ -#include "opencl/test/unit_test/mocks/mock_wddm.h" +#include "shared/test/common/mocks/mock_wddm.h" #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" @@ -14,9 +14,8 @@ #include "shared/source/os_interface/windows/os_environment_win.h" #include "shared/source/os_interface/windows/wddm_allocation.h" #include "shared/test/common/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" +#include "shared/test/common/mocks/mock_wddm_residency_allocations_container.h" +#include "shared/test/common/mocks/mock_wddm_residency_logger.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/mocks/mock_wddm.h b/shared/test/common/mocks/mock_wddm.h similarity index 99% rename from opencl/test/unit_test/mocks/mock_wddm.h rename to shared/test/common/mocks/mock_wddm.h index becbb19984..ab1079eb86 100644 --- a/opencl/test/unit_test/mocks/mock_wddm.h +++ b/shared/test/common/mocks/mock_wddm.h @@ -13,8 +13,7 @@ #include "shared/source/os_interface/windows/wddm/wddm.h" #include "shared/source/os_interface/windows/wddm_residency_allocations_container.h" #include "shared/source/os_interface/windows/windows_defs.h" - -#include "opencl/test/unit_test/mocks/wddm_mock_helpers.h" +#include "shared/test/common/mocks/wddm_mock_helpers.h" #include "gmock/gmock.h" diff --git a/opencl/test/unit_test/mocks/mock_wddm_interface20.h b/shared/test/common/mocks/mock_wddm_interface20.h similarity index 95% rename from opencl/test/unit_test/mocks/mock_wddm_interface20.h rename to shared/test/common/mocks/mock_wddm_interface20.h index 8145c1e8bd..35023c7f33 100644 --- a/opencl/test/unit_test/mocks/mock_wddm_interface20.h +++ b/shared/test/common/mocks/mock_wddm_interface20.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2020 Intel Corporation + * Copyright (C) 2019-2021 Intel Corporation * * SPDX-License-Identifier: MIT * diff --git a/opencl/test/unit_test/mocks/mock_wddm_residency_allocations_container.h b/shared/test/common/mocks/mock_wddm_residency_allocations_container.h similarity index 97% rename from opencl/test/unit_test/mocks/mock_wddm_residency_allocations_container.h rename to shared/test/common/mocks/mock_wddm_residency_allocations_container.h index 92c6e31d88..dcd91fca86 100644 --- a/opencl/test/unit_test/mocks/mock_wddm_residency_allocations_container.h +++ b/shared/test/common/mocks/mock_wddm_residency_allocations_container.h @@ -8,8 +8,7 @@ #pragma once #include "shared/source/memory_manager/memory_operations_status.h" #include "shared/source/os_interface/windows/wddm_residency_allocations_container.h" - -#include "opencl/test/unit_test/mocks/wddm_mock_helpers.h" +#include "shared/test/common/mocks/wddm_mock_helpers.h" namespace NEO { class Wddm; diff --git a/opencl/test/unit_test/mocks/mock_wddm_residency_logger.h b/shared/test/common/mocks/mock_wddm_residency_logger.h similarity index 95% rename from opencl/test/unit_test/mocks/mock_wddm_residency_logger.h rename to shared/test/common/mocks/mock_wddm_residency_logger.h index c53d045f31..9ada0b001b 100644 --- a/opencl/test/unit_test/mocks/mock_wddm_residency_logger.h +++ b/shared/test/common/mocks/mock_wddm_residency_logger.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * diff --git a/opencl/test/unit_test/mocks/wddm_mock_helpers.h b/shared/test/common/mocks/wddm_mock_helpers.h similarity index 96% rename from opencl/test/unit_test/mocks/wddm_mock_helpers.h rename to shared/test/common/mocks/wddm_mock_helpers.h index a49a2233dc..69356908b1 100644 --- a/opencl/test/unit_test/mocks/wddm_mock_helpers.h +++ b/shared/test/common/mocks/wddm_mock_helpers.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2020 Intel Corporation + * Copyright (C) 2019-2021 Intel Corporation * * SPDX-License-Identifier: MIT * diff --git a/shared/test/common/os_interface/CMakeLists.txt b/shared/test/common/os_interface/CMakeLists.txt new file mode 100644 index 0000000000..a1209b65ad --- /dev/null +++ b/shared/test/common/os_interface/CMakeLists.txt @@ -0,0 +1,11 @@ +# +# Copyright (C) 2021 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +target_sources(${TARGET_NAME} PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt +) + +add_subdirectories() diff --git a/shared/test/common/os_interface/windows/CMakeLists.txt b/shared/test/common/os_interface/windows/CMakeLists.txt new file mode 100644 index 0000000000..e6fa345983 --- /dev/null +++ b/shared/test/common/os_interface/windows/CMakeLists.txt @@ -0,0 +1,13 @@ +# +# Copyright (C) 2021 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +target_sources(${TARGET_NAME} PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/gdi_dll_fixture.h + ${CMAKE_CURRENT_SOURCE_DIR}/wddm_fixture.h +) + +set_property(GLOBAL PROPERTY NEO_CORE_SHARED_TESTS_OS_INTERFACE_WINDOWS ${NEO_CORE_SHARED_TESTS_OS_INTERFACE_WINDOWS}) diff --git a/opencl/test/unit_test/os_interface/windows/gdi_dll_fixture.h b/shared/test/common/os_interface/windows/gdi_dll_fixture.h similarity index 100% rename from opencl/test/unit_test/os_interface/windows/gdi_dll_fixture.h rename to shared/test/common/os_interface/windows/gdi_dll_fixture.h diff --git a/opencl/test/unit_test/os_interface/windows/wddm_fixture.h b/shared/test/common/os_interface/windows/wddm_fixture.h similarity index 92% rename from opencl/test/unit_test/os_interface/windows/wddm_fixture.h rename to shared/test/common/os_interface/windows/wddm_fixture.h index 73eb88936c..5a56b7d0c5 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_fixture.h +++ b/shared/test/common/os_interface/windows/wddm_fixture.h @@ -16,15 +16,15 @@ #include "shared/source/os_interface/windows/os_context_win.h" #include "shared/source/os_interface/windows/os_environment_win.h" #include "shared/source/os_interface/windows/wddm_memory_operations_handler.h" +#include "shared/test/common/fixtures/mock_execution_environment_gmm_fixture.h" #include "shared/test/common/helpers/default_hw_info.h" +#include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/mocks/mock_wddm.h" +#include "shared/test/common/mocks/mock_wddm_interface20.h" +#include "shared/test/common/mocks/mock_wddm_residency_allocations_container.h" +#include "shared/test/common/os_interface/windows/gdi_dll_fixture.h" #include "shared/test/unit_test/os_interface/windows/mock_gdi_interface.h" -#include "opencl/test/unit_test/fixtures/mock_execution_environment_gmm_fixture.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" -#include "opencl/test/unit_test/mocks/mock_wddm.h" -#include "opencl/test/unit_test/mocks/mock_wddm_interface20.h" -#include "opencl/test/unit_test/mocks/mock_wddm_residency_allocations_container.h" -#include "opencl/test/unit_test/os_interface/windows/gdi_dll_fixture.h" #include "test.h" #include "mock_gmm_memory.h" diff --git a/shared/test/unit_test/CMakeLists.txt b/shared/test/unit_test/CMakeLists.txt index 78f255b735..0e5edb8eaf 100644 --- a/shared/test/unit_test/CMakeLists.txt +++ b/shared/test/unit_test/CMakeLists.txt @@ -49,7 +49,6 @@ if(NOT SKIP_UNIT_TESTS) ${CMAKE_CURRENT_SOURCE_DIR}/tests_configuration.h ${CORE_ENABLERS} ${NEO_SOURCE_DIR}/opencl/source/compiler_interface/default_cache_config.cpp - ${NEO_SOURCE_DIR}/opencl/test/unit_test/fixtures/mock_execution_environment_gmm_fixture.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/global_environment.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/helpers/kernel_binary_helper_hash_value.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/libult/create_command_stream.cpp @@ -57,9 +56,9 @@ if(NOT SKIP_UNIT_TESTS) ${NEO_SOURCE_DIR}/opencl/test/unit_test/mocks/mock_platform.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/test_macros/test_checks_ocl.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/ult_config_listener.cpp - ${NEO_SOURCE_DIR}/shared/source/helpers/allow_deferred_deleter.cpp - ${NEO_SOURCE_DIR}/shared/test/common/helpers/api_specific_config_shared_tests.cpp - ${NEO_SOURCE_DIR}/shared/test/common/test_macros/test_checks_shared.cpp + ${NEO_SHARED_DIRECTORY}/helpers/allow_deferred_deleter.cpp + ${NEO_SHARED_TEST_DIRECTORY}/common/helpers/api_specific_config_shared_tests.cpp + ${NEO_SHARED_TEST_DIRECTORY}/common/test_macros/test_checks_shared.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/test_configuration/unit_tests/ult_configuration.cpp $ $ @@ -72,8 +71,8 @@ if(NOT SKIP_UNIT_TESTS) ${NEO_SOURCE_DIR}/opencl/test/unit_test/os_interface/linux/drm_neo_create.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/os_interface/linux/options.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/os_interface/linux/sys_calls_linux_ult.cpp - ${NEO_SOURCE_DIR}/shared/test/common/mocks/linux/mock_drm_memory_manager.cpp - ${NEO_SOURCE_DIR}/shared/test/common/mocks/linux/mock_drm_memory_manager.h + ${NEO_SHARED_TEST_DIRECTORY}/common/mocks/linux/mock_drm_memory_manager.cpp + ${NEO_SHARED_TEST_DIRECTORY}/common/mocks/linux/mock_drm_memory_manager.h ) if(NOT DISABLE_WDDM_LINUX) target_sources(${TARGET_NAME} PRIVATE diff --git a/shared/test/unit_test/built_ins/sip_tests.cpp b/shared/test/unit_test/built_ins/sip_tests.cpp index e2e02dd254..b0197346ef 100644 --- a/shared/test/unit_test/built_ins/sip_tests.cpp +++ b/shared/test/unit_test/built_ins/sip_tests.cpp @@ -9,9 +9,9 @@ #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/variable_backup.h" #include "shared/test/common/mocks/mock_device.h" +#include "shared/test/common/mocks/mock_io_functions.h" #include "shared/test/common/mocks/mock_sip.h" -#include "opencl/test/unit_test/mocks/mock_io_functions.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" #include "test.h" diff --git a/shared/test/unit_test/direct_submission/direct_submission_tests.cpp b/shared/test/unit_test/direct_submission/direct_submission_tests.cpp index 69303564b8..af2b322b5b 100644 --- a/shared/test/unit_test/direct_submission/direct_submission_tests.cpp +++ b/shared/test/unit_test/direct_submission/direct_submission_tests.cpp @@ -17,9 +17,9 @@ #include "shared/test/common/helpers/variable_backup.h" #include "shared/test/common/mocks/mock_direct_submission_diagnostic_collector.h" #include "shared/test/common/mocks/mock_direct_submission_hw.h" +#include "shared/test/common/mocks/mock_io_functions.h" #include "opencl/test/unit_test/mocks/mock_csr.h" -#include "opencl/test/unit_test/mocks/mock_io_functions.h" #include "test.h" using DirectSubmissionTest = Test; diff --git a/shared/test/unit_test/direct_submission/windows/wddm_direct_submission_tests.cpp b/shared/test/unit_test/direct_submission/windows/wddm_direct_submission_tests.cpp index fb118583f4..99cc6b7439 100644 --- a/shared/test/unit_test/direct_submission/windows/wddm_direct_submission_tests.cpp +++ b/shared/test/unit_test/direct_submission/windows/wddm_direct_submission_tests.cpp @@ -15,10 +15,9 @@ #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/ult_hw_config.h" #include "shared/test/common/mocks/mock_device.h" +#include "shared/test/common/mocks/mock_io_functions.h" #include "shared/test/common/mocks/windows/mock_wddm_direct_submission.h" - -#include "opencl/test/unit_test/mocks/mock_io_functions.h" -#include "opencl/test/unit_test/os_interface/windows/wddm_fixture.h" +#include "shared/test/common/os_interface/windows/wddm_fixture.h" struct WddmDirectSubmissionFixture : public WddmFixture { void SetUp() override { diff --git a/shared/test/unit_test/fixtures/CMakeLists.txt b/shared/test/unit_test/fixtures/CMakeLists.txt index afe32039d4..d45aec1714 100644 --- a/shared/test/unit_test/fixtures/CMakeLists.txt +++ b/shared/test/unit_test/fixtures/CMakeLists.txt @@ -6,6 +6,7 @@ target_sources(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/mock_aub_center_fixture.h ${CMAKE_CURRENT_SOURCE_DIR}/templated_fixture_tests.cpp ) diff --git a/opencl/test/unit_test/fixtures/mock_aub_center_fixture.h b/shared/test/unit_test/fixtures/mock_aub_center_fixture.h similarity index 90% rename from opencl/test/unit_test/fixtures/mock_aub_center_fixture.h rename to shared/test/unit_test/fixtures/mock_aub_center_fixture.h index 25cb4578fe..d56a4d3330 100644 --- a/opencl/test/unit_test/fixtures/mock_aub_center_fixture.h +++ b/shared/test/unit_test/fixtures/mock_aub_center_fixture.h @@ -9,11 +9,11 @@ #include "shared/source/execution_environment/root_device_environment.h" #include "shared/test/common/helpers/default_hw_info.h" +#include "shared/test/common/mocks/mock_aub_center.h" #include "shared/test/common/mocks/mock_aub_manager.h" #include "shared/test/unit_test/tests_configuration.h" #include "opencl/source/platform/platform.h" -#include "opencl/test/unit_test/mocks/mock_aub_center.h" #include "opencl/test/unit_test/mocks/mock_platform.h" namespace NEO { @@ -23,7 +23,6 @@ struct MockAubCenterFixture { MockAubCenterFixture(CommandStreamReceiverType commandStreamReceiverType) : commandStreamReceiverType(commandStreamReceiverType){}; void SetUp() { // NOLINT(readability-identifier-naming) - setMockAubCenter(*platform()->peekExecutionEnvironment()->rootDeviceEnvironments[0], commandStreamReceiverType); } void TearDown() { // NOLINT(readability-identifier-naming) } diff --git a/shared/test/unit_test/memory_manager/deferrable_allocation_deletion_tests.cpp b/shared/test/unit_test/memory_manager/deferrable_allocation_deletion_tests.cpp index 99b5b9a5b4..c842afe54d 100644 --- a/shared/test/unit_test/memory_manager/deferrable_allocation_deletion_tests.cpp +++ b/shared/test/unit_test/memory_manager/deferrable_allocation_deletion_tests.cpp @@ -12,11 +12,9 @@ #include "shared/source/os_interface/os_context.h" #include "shared/test/common/mocks/mock_device.h" -#include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/libult/ult_command_stream_receiver.h" #include "opencl/test/unit_test/mocks/mock_allocation_properties.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" -#include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" using namespace NEO; diff --git a/shared/test/unit_test/memory_manager/graphics_allocation_tests.cpp b/shared/test/unit_test/memory_manager/graphics_allocation_tests.cpp index 8d0f529d60..be4ce127b5 100644 --- a/shared/test/unit_test/memory_manager/graphics_allocation_tests.cpp +++ b/shared/test/unit_test/memory_manager/graphics_allocation_tests.cpp @@ -5,10 +5,10 @@ * */ +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/mock_graphics_allocation.h" #include "opencl/test/unit_test/mocks/mock_aub_csr.h" -#include "opencl/test/unit_test/mocks/mock_execution_environment.h" #include "test.h" using namespace NEO; diff --git a/shared/test/unit_test/os_interface/windows/gmm_app_resource_tests.cpp b/shared/test/unit_test/os_interface/windows/gmm_app_resource_tests.cpp index ba1f4b568a..74b555c206 100644 --- a/shared/test/unit_test/os_interface/windows/gmm_app_resource_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/gmm_app_resource_tests.cpp @@ -13,10 +13,10 @@ #include "shared/source/helpers/app_resource_helper.h" #include "shared/source/helpers/hw_info.h" #include "shared/source/helpers/string.h" +#include "shared/test/common/fixtures/mock_execution_environment_gmm_fixture.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/mocks/mock_graphics_allocation.h" -#include "opencl/test/unit_test/fixtures/mock_execution_environment_gmm_fixture.h" #include "opencl/test/unit_test/mocks/mock_memory_manager.h" #include "test.h" diff --git a/shared/test/unit_test/os_interface/windows/wddm_preemption_tests.cpp b/shared/test/unit_test/os_interface/windows/wddm_preemption_tests.cpp index 342a19c4ef..5bfdccb3f7 100644 --- a/shared/test/unit_test/os_interface/windows/wddm_preemption_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm_preemption_tests.cpp @@ -9,8 +9,8 @@ #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/helpers/hw_helper.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/os_interface/windows/wddm_fixture.h" -#include "opencl/test/unit_test/os_interface/windows/wddm_fixture.h" #include "test.h" using namespace NEO; diff --git a/shared/test/unit_test/os_interface/windows/wddm_special_heap_test.cpp b/shared/test/unit_test/os_interface/windows/wddm_special_heap_test.cpp index bb91c733dd..1586dfc008 100644 --- a/shared/test/unit_test/os_interface/windows/wddm_special_heap_test.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm_special_heap_test.cpp @@ -11,8 +11,8 @@ #include "shared/source/os_interface/os_interface.h" #include "shared/test/common/fixtures/device_fixture.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/mocks/mock_wddm.h" -#include "opencl/test/unit_test/mocks/mock_wddm.h" #include "opencl/test/unit_test/os_interface/windows/mock_wddm_memory_manager.h" #include "test.h" diff --git a/shared/test/unit_test/os_interface/windows/wddm_tests.cpp b/shared/test/unit_test/os_interface/windows/wddm_tests.cpp index 3def7c5937..651833046f 100644 --- a/shared/test/unit_test/os_interface/windows/wddm_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm_tests.cpp @@ -6,8 +6,8 @@ */ #include "shared/source/gmm_helper/gmm.h" +#include "shared/test/common/os_interface/windows/wddm_fixture.h" -#include "opencl/test/unit_test/os_interface/windows/wddm_fixture.h" #include "test.h" namespace NEO { diff --git a/shared/test/unit_test/utilities/io_functions_tests.cpp b/shared/test/unit_test/utilities/io_functions_tests.cpp index d8e4aae7eb..08969b251d 100644 --- a/shared/test/unit_test/utilities/io_functions_tests.cpp +++ b/shared/test/unit_test/utilities/io_functions_tests.cpp @@ -5,7 +5,8 @@ * */ -#include "opencl/test/unit_test/mocks/mock_io_functions.h" +#include "shared/test/common/mocks/mock_io_functions.h" + #include "test.h" using namespace NEO;