diff --git a/opencl/test/unit_test/xe_hpc_core/CMakeLists.txt b/opencl/test/unit_test/xe_hpc_core/CMakeLists.txt index 22244b226e..96a6dcdd9b 100644 --- a/opencl/test/unit_test/xe_hpc_core/CMakeLists.txt +++ b/opencl/test/unit_test/xe_hpc_core/CMakeLists.txt @@ -28,12 +28,6 @@ if(TESTS_XE_HPC_CORE) ${CMAKE_CURRENT_SOURCE_DIR}/api_tests_xe_hpc_core.cpp ) - if(DEFINED AUB_STREAM_PROJECT_NAME) - list(APPEND IGDRCL_SRCS_tests_xe_hpc_core - ${CMAKE_CURRENT_SOURCE_DIR}/aub_center_using_aubstream_lib_tests_xe_hpc_core.cpp - ) - endif() - get_property(NEO_CORE_TESTS_XE_HPC_CORE GLOBAL PROPERTY NEO_CORE_TESTS_XE_HPC_CORE) list(APPEND IGDRCL_SRCS_tests_xe_hpc_core ${NEO_CORE_TESTS_XE_HPC_CORE}) diff --git a/opencl/test/unit_test/xe_hpg_core/CMakeLists.txt b/opencl/test/unit_test/xe_hpg_core/CMakeLists.txt index 81d511ede9..24dd015610 100644 --- a/opencl/test/unit_test/xe_hpg_core/CMakeLists.txt +++ b/opencl/test/unit_test/xe_hpg_core/CMakeLists.txt @@ -23,12 +23,6 @@ if(TESTS_XE_HPG_CORE) ${CMAKE_CURRENT_SOURCE_DIR}/image_tests_xe_hpg_core.cpp ) - if(DEFINED AUB_STREAM_PROJECT_NAME) - list(APPEND IGDRCL_SRCS_tests_xe_hpg_core - ${CMAKE_CURRENT_SOURCE_DIR}/aub_center_using_aubstream_lib_tests_xe_hpg_core.cpp - ) - endif() - get_property(NEO_CORE_TESTS_XE_HPG_CORE GLOBAL PROPERTY NEO_CORE_TESTS_XE_HPG_CORE) list(APPEND IGDRCL_SRCS_tests_xe_hpg_core ${NEO_CORE_TESTS_XE_HPG_CORE}) diff --git a/opencl/test/unit_test/aub/CMakeLists.txt b/shared/test/unit_test/aub/CMakeLists.txt similarity index 72% rename from opencl/test/unit_test/aub/CMakeLists.txt rename to shared/test/unit_test/aub/CMakeLists.txt index d669fc7238..9e90a6136e 100644 --- a/opencl/test/unit_test/aub/CMakeLists.txt +++ b/shared/test/unit_test/aub/CMakeLists.txt @@ -4,17 +4,17 @@ # SPDX-License-Identifier: MIT # -set(IGDRCL_SRCS_aub_helper_tests +set(NEO_SHARED_aub_helper_tests ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/aub_center_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/aub_helper_tests.cpp ) if(NOT DEFINED AUB_STREAM_PROJECT_NAME) - list(APPEND IGDRCL_SRCS_aub_helper_tests + list(APPEND NEO_SHARED_aub_helper_tests ${CMAKE_CURRENT_SOURCE_DIR}/aub_center_using_aubstream_stubs_tests.cpp ) endif() -target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_aub_helper_tests}) +target_sources(${TARGET_NAME} PRIVATE ${NEO_SHARED_aub_helper_tests}) add_subdirectories() diff --git a/opencl/test/unit_test/aub/aub_center_tests.cpp b/shared/test/unit_test/aub/aub_center_tests.cpp similarity index 100% rename from opencl/test/unit_test/aub/aub_center_tests.cpp rename to shared/test/unit_test/aub/aub_center_tests.cpp diff --git a/opencl/test/unit_test/aub/aub_center_using_aubstream_stubs_tests.cpp b/shared/test/unit_test/aub/aub_center_using_aubstream_stubs_tests.cpp similarity index 100% rename from opencl/test/unit_test/aub/aub_center_using_aubstream_stubs_tests.cpp rename to shared/test/unit_test/aub/aub_center_using_aubstream_stubs_tests.cpp diff --git a/opencl/test/unit_test/aub/aub_helper_tests.cpp b/shared/test/unit_test/aub/aub_helper_tests.cpp similarity index 98% rename from opencl/test/unit_test/aub/aub_helper_tests.cpp rename to shared/test/unit_test/aub/aub_helper_tests.cpp index 8921d03822..aab5b609d4 100644 --- a/opencl/test/unit_test/aub/aub_helper_tests.cpp +++ b/shared/test/unit_test/aub/aub_helper_tests.cpp @@ -12,12 +12,11 @@ #include "shared/source/helpers/basic_math.h" #include "shared/source/helpers/hw_helper.h" #include "shared/source/tbx/tbx_proto.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_lrca_helper.h" #include "shared/test/common/test_macros/test.h" -#include "opencl/test/unit_test/fixtures/cl_device_fixture.h" - using namespace NEO; TEST(AubHelper, GivenZeroPdEntryBitsWhenGetMemTraceIsCalledThenTraceNonLocalIsReturned) { @@ -106,7 +105,7 @@ TEST(AubHelper, WhenHBMSizePerTileInGigabytesIsNotSetThenGetMemBankSizeReturnsCo EXPECT_EQ(8 * MemoryConstants::gigaByte, AubHelper::getPerTileLocalMemorySize(&hwInfo)); } -using AubHelperHwTest = Test; +using AubHelperHwTest = Test; HWTEST_F(AubHelperHwTest, GivenDisabledLocalMemoryWhenGetDataHintForPml4EntryIsCalledThenTraceNotypeIsReturned) { AubHelperHw aubHelper(false); diff --git a/shared/test/unit_test/xe_hp_core/CMakeLists.txt b/shared/test/unit_test/xe_hp_core/CMakeLists.txt index dd0fc5c643..79d9133c5c 100644 --- a/shared/test/unit_test/xe_hp_core/CMakeLists.txt +++ b/shared/test/unit_test/xe_hp_core/CMakeLists.txt @@ -5,9 +5,16 @@ # if(TESTS_XE_HP_CORE) - target_sources(neo_shared_tests PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt - ${CMAKE_CURRENT_SOURCE_DIR}/hw_cmds_xe_hp_core_tests.cpp + set(NEO_SHARED_tests_xe_hp_core + ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/hw_cmds_xe_hp_core_tests.cpp ) + + if(DEFINED AUB_STREAM_PROJECT_NAME) + list(APPEND NEO_SHARED_tests_xe_hp_core + ${CMAKE_CURRENT_SOURCE_DIR}/aub_center_using_aubstream_lib_tests_xe_hp_core.cpp + ) + endif() + target_sources(${TARGET_NAME} PRIVATE ${NEO_SHARED_tests_xe_hp_core}) add_subdirectories() endif() diff --git a/shared/test/unit_test/xe_hp_core/aub_center_using_aubstream_lib_tests_xe_hp_core.cpp b/shared/test/unit_test/xe_hp_core/aub_center_using_aubstream_lib_tests_xe_hp_core.cpp new file mode 100644 index 0000000000..05c39acbb5 --- /dev/null +++ b/shared/test/unit_test/xe_hp_core/aub_center_using_aubstream_lib_tests_xe_hp_core.cpp @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2021 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/debug_settings/debug_settings_manager.h" +#include "shared/source/gmm_helper/gmm_helper.h" +#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/test_macros/test.h" +using namespace NEO; +using XeHpCoreAubCenterTests = ::testing::Test; + +XE_HP_CORE_TEST_F(XeHpCoreAubCenterTests, GivenUseAubStreamDebugVariableSetWhenAubCenterIsCreatedThenAubCenterCreatesAubManager) { + DebugManagerStateRestore restorer; + DebugManager.flags.UseAubStream.set(true); + + GmmHelper gmmHelper(nullptr, defaultHwInfo.get()); + + MockAubCenter aubCenter(defaultHwInfo.get(), gmmHelper, false, "", CommandStreamReceiverType::CSR_AUB); + + EXPECT_NE(nullptr, aubCenter.aubManager.get()); +} diff --git a/shared/test/unit_test/xe_hpc_core/CMakeLists.txt b/shared/test/unit_test/xe_hpc_core/CMakeLists.txt index 8cb8426a11..4e2b387b26 100644 --- a/shared/test/unit_test/xe_hpc_core/CMakeLists.txt +++ b/shared/test/unit_test/xe_hpc_core/CMakeLists.txt @@ -5,11 +5,19 @@ # if(TESTS_XE_HPC_CORE) - target_sources(neo_shared_tests PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt - ${CMAKE_CURRENT_SOURCE_DIR}/aub_command_stream_receiver_2_tests_xe_hpc_core.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/hw_cmds_xe_hpc_core_tests.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_xe_hpc_core_tests.cpp + set(NEO_SHARED_tests_xe_hpc_core + ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/aub_command_stream_receiver_2_tests_xe_hpc_core.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/hw_cmds_xe_hpc_core_tests.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_xe_hpc_core_tests.cpp ) + + if(DEFINED AUB_STREAM_PROJECT_NAME) + list(APPEND NEO_SHARED_tests_xe_hpc_core + ${CMAKE_CURRENT_SOURCE_DIR}/aub_center_using_aubstream_lib_tests_xe_hpc_core.cpp + ) + endif() + + target_sources(${TARGET_NAME} PRIVATE ${NEO_SHARED_tests_xe_hpc_core}) add_subdirectories() endif() diff --git a/opencl/test/unit_test/xe_hpc_core/aub_center_using_aubstream_lib_tests_xe_hpc_core.cpp b/shared/test/unit_test/xe_hpc_core/aub_center_using_aubstream_lib_tests_xe_hpc_core.cpp similarity index 100% rename from opencl/test/unit_test/xe_hpc_core/aub_center_using_aubstream_lib_tests_xe_hpc_core.cpp rename to shared/test/unit_test/xe_hpc_core/aub_center_using_aubstream_lib_tests_xe_hpc_core.cpp diff --git a/shared/test/unit_test/xe_hpg_core/CMakeLists.txt b/shared/test/unit_test/xe_hpg_core/CMakeLists.txt index 98b54ae76f..09a974db09 100644 --- a/shared/test/unit_test/xe_hpg_core/CMakeLists.txt +++ b/shared/test/unit_test/xe_hpg_core/CMakeLists.txt @@ -5,9 +5,16 @@ # if(TESTS_XE_HPG_CORE) - target_sources(neo_shared_tests PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt - ${CMAKE_CURRENT_SOURCE_DIR}/hw_cmds_xe_hpg_core_tests.cpp + set(NEO_SHARED_tests_xe_hpg_core + ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/hw_cmds_xe_hpg_core_tests.cpp ) + + if(DEFINED AUB_STREAM_PROJECT_NAME) + list(APPEND NEO_SHARED_tests_xe_hpg_core + ${CMAKE_CURRENT_SOURCE_DIR}/aub_center_using_aubstream_lib_tests_xe_hpg_core.cpp + ) + endif() + target_sources(${TARGET_NAME} PRIVATE ${NEO_SHARED_tests_xe_hpg_core}) add_subdirectories() endif() diff --git a/opencl/test/unit_test/xe_hpg_core/aub_center_using_aubstream_lib_tests_xe_hpg_core.cpp b/shared/test/unit_test/xe_hpg_core/aub_center_using_aubstream_lib_tests_xe_hpg_core.cpp similarity index 81% rename from opencl/test/unit_test/xe_hpg_core/aub_center_using_aubstream_lib_tests_xe_hpg_core.cpp rename to shared/test/unit_test/xe_hpg_core/aub_center_using_aubstream_lib_tests_xe_hpg_core.cpp index a5e5f9e076..1aec998a41 100644 --- a/opencl/test/unit_test/xe_hpg_core/aub_center_using_aubstream_lib_tests_xe_hpg_core.cpp +++ b/shared/test/unit_test/xe_hpg_core/aub_center_using_aubstream_lib_tests_xe_hpg_core.cpp @@ -13,9 +13,9 @@ #include "shared/test/common/mocks/mock_aub_center.h" #include "shared/test/common/test_macros/test.h" using namespace NEO; -typedef ::testing::Test xe_hpg_coreAubCenterTests; +using XeHpgCoreAubCenterTests = ::testing::Test; -XE_HPG_CORETEST_F(xe_hpg_coreAubCenterTests, GivenUseAubStreamDebugVariableSetWhenAubCenterIsCreatedThenAubCenterCreatesAubManager) { +XE_HPG_CORETEST_F(XeHpgCoreAubCenterTests, GivenUseAubStreamDebugVariableSetWhenAubCenterIsCreatedThenAubCenterCreatesAubManager) { DebugManagerStateRestore restorer; DebugManager.flags.UseAubStream.set(true);