Skip to content

Commit 732fbe5

Browse files
Move aub unit tests to shared directory
Signed-off-by: Zbigniew Zdanowicz <[email protected]>
1 parent 962d98a commit 732fbe5

12 files changed

+67
-31
lines changed

opencl/test/unit_test/xe_hpc_core/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ if(TESTS_XE_HPC_CORE)
2828
${CMAKE_CURRENT_SOURCE_DIR}/api_tests_xe_hpc_core.cpp
2929
)
3030

31-
if(DEFINED AUB_STREAM_PROJECT_NAME)
32-
list(APPEND IGDRCL_SRCS_tests_xe_hpc_core
33-
${CMAKE_CURRENT_SOURCE_DIR}/aub_center_using_aubstream_lib_tests_xe_hpc_core.cpp
34-
)
35-
endif()
36-
3731
get_property(NEO_CORE_TESTS_XE_HPC_CORE GLOBAL PROPERTY NEO_CORE_TESTS_XE_HPC_CORE)
3832
list(APPEND IGDRCL_SRCS_tests_xe_hpc_core ${NEO_CORE_TESTS_XE_HPC_CORE})
3933

opencl/test/unit_test/xe_hpg_core/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ if(TESTS_XE_HPG_CORE)
2323
${CMAKE_CURRENT_SOURCE_DIR}/image_tests_xe_hpg_core.cpp
2424
)
2525

26-
if(DEFINED AUB_STREAM_PROJECT_NAME)
27-
list(APPEND IGDRCL_SRCS_tests_xe_hpg_core
28-
${CMAKE_CURRENT_SOURCE_DIR}/aub_center_using_aubstream_lib_tests_xe_hpg_core.cpp
29-
)
30-
endif()
31-
3226
get_property(NEO_CORE_TESTS_XE_HPG_CORE GLOBAL PROPERTY NEO_CORE_TESTS_XE_HPG_CORE)
3327
list(APPEND IGDRCL_SRCS_tests_xe_hpg_core ${NEO_CORE_TESTS_XE_HPG_CORE})
3428

opencl/test/unit_test/aub/CMakeLists.txt renamed to shared/test/unit_test/aub/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
# SPDX-License-Identifier: MIT
55
#
66

7-
set(IGDRCL_SRCS_aub_helper_tests
7+
set(NEO_SHARED_aub_helper_tests
88
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
99
${CMAKE_CURRENT_SOURCE_DIR}/aub_center_tests.cpp
1010
${CMAKE_CURRENT_SOURCE_DIR}/aub_helper_tests.cpp
1111
)
1212

1313
if(NOT DEFINED AUB_STREAM_PROJECT_NAME)
14-
list(APPEND IGDRCL_SRCS_aub_helper_tests
14+
list(APPEND NEO_SHARED_aub_helper_tests
1515
${CMAKE_CURRENT_SOURCE_DIR}/aub_center_using_aubstream_stubs_tests.cpp
1616
)
1717
endif()
1818

19-
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_aub_helper_tests})
19+
target_sources(${TARGET_NAME} PRIVATE ${NEO_SHARED_aub_helper_tests})
2020
add_subdirectories()

opencl/test/unit_test/aub/aub_helper_tests.cpp renamed to shared/test/unit_test/aub/aub_helper_tests.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
#include "shared/source/helpers/basic_math.h"
1313
#include "shared/source/helpers/hw_helper.h"
1414
#include "shared/source/tbx/tbx_proto.h"
15+
#include "shared/test/common/fixtures/device_fixture.h"
1516
#include "shared/test/common/helpers/debug_manager_state_restore.h"
1617
#include "shared/test/common/mocks/mock_lrca_helper.h"
1718
#include "shared/test/common/test_macros/test.h"
1819

19-
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
20-
2120
using namespace NEO;
2221

2322
TEST(AubHelper, GivenZeroPdEntryBitsWhenGetMemTraceIsCalledThenTraceNonLocalIsReturned) {
@@ -106,7 +105,7 @@ TEST(AubHelper, WhenHBMSizePerTileInGigabytesIsNotSetThenGetMemBankSizeReturnsCo
106105
EXPECT_EQ(8 * MemoryConstants::gigaByte, AubHelper::getPerTileLocalMemorySize(&hwInfo));
107106
}
108107

109-
using AubHelperHwTest = Test<ClDeviceFixture>;
108+
using AubHelperHwTest = Test<DeviceFixture>;
110109

111110
HWTEST_F(AubHelperHwTest, GivenDisabledLocalMemoryWhenGetDataHintForPml4EntryIsCalledThenTraceNotypeIsReturned) {
112111
AubHelperHw<FamilyType> aubHelper(false);

shared/test/unit_test/xe_hp_core/CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,16 @@
55
#
66

77
if(TESTS_XE_HP_CORE)
8-
target_sources(neo_shared_tests PRIVATE
9-
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
10-
${CMAKE_CURRENT_SOURCE_DIR}/hw_cmds_xe_hp_core_tests.cpp
8+
set(NEO_SHARED_tests_xe_hp_core
9+
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
10+
${CMAKE_CURRENT_SOURCE_DIR}/hw_cmds_xe_hp_core_tests.cpp
1111
)
12+
13+
if(DEFINED AUB_STREAM_PROJECT_NAME)
14+
list(APPEND NEO_SHARED_tests_xe_hp_core
15+
${CMAKE_CURRENT_SOURCE_DIR}/aub_center_using_aubstream_lib_tests_xe_hp_core.cpp
16+
)
17+
endif()
18+
target_sources(${TARGET_NAME} PRIVATE ${NEO_SHARED_tests_xe_hp_core})
1219
add_subdirectories()
1320
endif()
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (C) 2021 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "shared/source/debug_settings/debug_settings_manager.h"
9+
#include "shared/source/gmm_helper/gmm_helper.h"
10+
#include "shared/source/helpers/hw_info.h"
11+
#include "shared/test/common/helpers/debug_manager_state_restore.h"
12+
#include "shared/test/common/helpers/default_hw_info.h"
13+
#include "shared/test/common/mocks/mock_aub_center.h"
14+
#include "shared/test/common/test_macros/test.h"
15+
using namespace NEO;
16+
using XeHpCoreAubCenterTests = ::testing::Test;
17+
18+
XE_HP_CORE_TEST_F(XeHpCoreAubCenterTests, GivenUseAubStreamDebugVariableSetWhenAubCenterIsCreatedThenAubCenterCreatesAubManager) {
19+
DebugManagerStateRestore restorer;
20+
DebugManager.flags.UseAubStream.set(true);
21+
22+
GmmHelper gmmHelper(nullptr, defaultHwInfo.get());
23+
24+
MockAubCenter aubCenter(defaultHwInfo.get(), gmmHelper, false, "", CommandStreamReceiverType::CSR_AUB);
25+
26+
EXPECT_NE(nullptr, aubCenter.aubManager.get());
27+
}

shared/test/unit_test/xe_hpc_core/CMakeLists.txt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,19 @@
55
#
66

77
if(TESTS_XE_HPC_CORE)
8-
target_sources(neo_shared_tests PRIVATE
9-
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
10-
${CMAKE_CURRENT_SOURCE_DIR}/aub_command_stream_receiver_2_tests_xe_hpc_core.cpp
11-
${CMAKE_CURRENT_SOURCE_DIR}/hw_cmds_xe_hpc_core_tests.cpp
12-
${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_xe_hpc_core_tests.cpp
8+
set(NEO_SHARED_tests_xe_hpc_core
9+
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
10+
${CMAKE_CURRENT_SOURCE_DIR}/aub_command_stream_receiver_2_tests_xe_hpc_core.cpp
11+
${CMAKE_CURRENT_SOURCE_DIR}/hw_cmds_xe_hpc_core_tests.cpp
12+
${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_xe_hpc_core_tests.cpp
1313
)
14+
15+
if(DEFINED AUB_STREAM_PROJECT_NAME)
16+
list(APPEND NEO_SHARED_tests_xe_hpc_core
17+
${CMAKE_CURRENT_SOURCE_DIR}/aub_center_using_aubstream_lib_tests_xe_hpc_core.cpp
18+
)
19+
endif()
20+
21+
target_sources(${TARGET_NAME} PRIVATE ${NEO_SHARED_tests_xe_hpc_core})
1422
add_subdirectories()
1523
endif()

shared/test/unit_test/xe_hpg_core/CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,16 @@
55
#
66

77
if(TESTS_XE_HPG_CORE)
8-
target_sources(neo_shared_tests PRIVATE
9-
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
10-
${CMAKE_CURRENT_SOURCE_DIR}/hw_cmds_xe_hpg_core_tests.cpp
8+
set(NEO_SHARED_tests_xe_hpg_core
9+
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
10+
${CMAKE_CURRENT_SOURCE_DIR}/hw_cmds_xe_hpg_core_tests.cpp
1111
)
12+
13+
if(DEFINED AUB_STREAM_PROJECT_NAME)
14+
list(APPEND NEO_SHARED_tests_xe_hpg_core
15+
${CMAKE_CURRENT_SOURCE_DIR}/aub_center_using_aubstream_lib_tests_xe_hpg_core.cpp
16+
)
17+
endif()
18+
target_sources(${TARGET_NAME} PRIVATE ${NEO_SHARED_tests_xe_hpg_core})
1219
add_subdirectories()
1320
endif()

opencl/test/unit_test/xe_hpg_core/aub_center_using_aubstream_lib_tests_xe_hpg_core.cpp renamed to shared/test/unit_test/xe_hpg_core/aub_center_using_aubstream_lib_tests_xe_hpg_core.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#include "shared/test/common/mocks/mock_aub_center.h"
1414
#include "shared/test/common/test_macros/test.h"
1515
using namespace NEO;
16-
typedef ::testing::Test xe_hpg_coreAubCenterTests;
16+
using XeHpgCoreAubCenterTests = ::testing::Test;
1717

18-
XE_HPG_CORETEST_F(xe_hpg_coreAubCenterTests, GivenUseAubStreamDebugVariableSetWhenAubCenterIsCreatedThenAubCenterCreatesAubManager) {
18+
XE_HPG_CORETEST_F(XeHpgCoreAubCenterTests, GivenUseAubStreamDebugVariableSetWhenAubCenterIsCreatedThenAubCenterCreatesAubManager) {
1919
DebugManagerStateRestore restorer;
2020
DebugManager.flags.UseAubStream.set(true);
2121

0 commit comments

Comments
 (0)