Use PrelimHelper for isDebugAttachAvailable

Signed-off-by: Daniel Chabrowski daniel.chabrowski@intel.com
Related-To: NEO-6591
This commit is contained in:
Daniel Chabrowski
2022-03-25 18:51:25 +00:00
committed by Compute-Runtime-Automation
parent 08e3853982
commit 5350553f72
8 changed files with 34 additions and 14 deletions

View File

@@ -12,7 +12,6 @@ set(NEO_CORE_OS_INTERFACE_TESTS_LINUX
${CMAKE_CURRENT_SOURCE_DIR}/drm_command_stream_l0_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}drm_engine_info_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drm_mock_impl.h
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}drm_query_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drm_query_topology_upstream_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drm_special_heap_test.cpp
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_uuid_tests.cpp
@@ -43,6 +42,7 @@ endif()
if("${BRANCH_TYPE}" STREQUAL "")
list(APPEND NEO_CORE_OS_INTERFACE_TESTS_LINUX
${CMAKE_CURRENT_SOURCE_DIR}/drm_debug_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drm_query_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drm_memory_info_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_tests_upstream.cpp
)

View File

@@ -209,6 +209,15 @@ TEST(DrmQueryTest, givenCreateContextWithAccessCounterWhenDrmContextIsCreatedThe
}
}
TEST(DrmQueryTest, WhenCallingIsDebugAttachAvailableThenReturnValueIsTrue) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
drm.allowDebugAttachCallBase = true;
EXPECT_TRUE(drm.isDebugAttachAvailable());
}
struct BufferObjectMock : public BufferObject {
using BufferObject::BufferObject;
using BufferObject::fillExecObject;

View File

@@ -18,15 +18,6 @@
using namespace NEO;
TEST(DrmQueryTest, WhenCallingIsDebugAttachAvailableThenReturnValueIsFalse) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
drm.allowDebugAttachCallBase = true;
EXPECT_FALSE(drm.isDebugAttachAvailable());
}
using HwConfigTopologyQuery = ::testing::Test;
HWTEST2_F(HwConfigTopologyQuery, WhenGettingTopologyFailsThenSetMaxValuesBasedOnSubsliceIoctlQuery, MatchAny) {
@@ -60,6 +51,15 @@ HWTEST2_F(HwConfigTopologyQuery, WhenGettingTopologyFailsThenSetMaxValuesBasedOn
EXPECT_EQ(static_cast<uint32_t>(drm->storedSSVal), outHwInfo.gtSystemInfo.SubSliceCount);
}
TEST(DrmQueryTest, WhenCallingIsDebugAttachAvailableThenReturnValueIsFalse) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
drm.allowDebugAttachCallBase = true;
EXPECT_FALSE(drm.isDebugAttachAvailable());
}
TEST(DrmQueryTest, WhenCallingQueryPageFaultSupportThenReturnFalse) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);