21
21
#include " shared/test/common/mocks/linux/mock_os_time_linux.h"
22
22
#include " shared/test/common/mocks/mock_execution_environment.h"
23
23
#include " shared/test/common/mocks/mock_io_functions.h"
24
+ #include " shared/test/common/os_interface/linux/xe/xe_config_fixture.h"
24
25
#include " shared/test/common/test_macros/hw_test.h"
25
26
#include " shared/test/common/test_macros/test.h"
26
27
27
28
using namespace NEO ;
28
29
29
- TEST (IoctlHelperXeTest, whenCallingDebuggerOpenIoctlThenProperValueIsReturned) {
30
+ using IoctlHelperXeTest = Test<XeConfigFixture>;
31
+ TEST_F (IoctlHelperXeTest, whenCallingDebuggerOpenIoctlThenProperValueIsReturned) {
30
32
int ret;
31
33
DebugManagerStateRestore restorer;
32
34
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
@@ -40,7 +42,7 @@ TEST(IoctlHelperXeTest, whenCallingDebuggerOpenIoctlThenProperValueIsReturned) {
40
42
EXPECT_EQ (ret, drm->debuggerOpenRetval );
41
43
}
42
44
43
- TEST (IoctlHelperXeTest, givenIoctlHelperXeWhenCallingGetIoctForDebuggerThenCorrectValueReturned) {
45
+ TEST_F (IoctlHelperXeTest, givenIoctlHelperXeWhenCallingGetIoctForDebuggerThenCorrectValueReturned) {
44
46
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
45
47
auto drm = DrmMockXeDebug::create (*executionEnvironment->rootDeviceEnvironments [0 ]);
46
48
auto xeIoctlHelper = drm->getIoctlHelper ();
@@ -56,7 +58,7 @@ TEST(IoctlHelperXeTest, givenIoctlHelperXeWhenCallingGetIoctForDebuggerThenCorre
56
58
verifyIoctlRequestValue (EuDebugParam::connect, DrmIoctl::debuggerOpen);
57
59
}
58
60
59
- TEST (IoctlHelperXeTest, givenIoctlHelperXeWhenCallingGetEudebugExtPropertyThenCorrectValueReturned) {
61
+ TEST_F (IoctlHelperXeTest, givenIoctlHelperXeWhenCallingGetEudebugExtPropertyThenCorrectValueReturned) {
60
62
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
61
63
executionEnvironment->setDebuggingMode (DebuggingMode::offline);
62
64
auto drm = DrmMockXeDebug::create (*executionEnvironment->rootDeviceEnvironments [0 ]);
@@ -162,14 +164,14 @@ HWTEST_F(IoctlHelperXeTestFixture, GivenContextCreatedForCopyEngineWhenCreateDrm
162
164
EXPECT_NE (ext.property , static_cast <uint32_t >(EuDebugParam::execQueueSetPropertyEuDebug));
163
165
}
164
166
165
- TEST (IoctlHelperXeTest, GivenXeDriverThenDebugAttachReturnsTrue) {
167
+ TEST_F (IoctlHelperXeTest, GivenXeDriverThenDebugAttachReturnsTrue) {
166
168
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
167
169
auto drm = DrmMockXeDebug::create (*executionEnvironment->rootDeviceEnvironments [0 ]);
168
170
auto xeIoctlHelper = static_cast <MockIoctlHelperXeDebug *>(drm->ioctlHelper .get ());
169
171
EXPECT_TRUE (xeIoctlHelper->isDebugAttachAvailable ());
170
172
}
171
173
172
- TEST (IoctlHelperXeTest, givenEuDebugSysFsContentWhenItIsZeroThenEuDebugInterfaceIsNotCreated) {
174
+ TEST_F (IoctlHelperXeTest, givenEuDebugSysFsContentWhenItIsZeroThenEuDebugInterfaceIsNotCreated) {
173
175
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
174
176
auto drm = DrmMockXeDebug::create (*executionEnvironment->rootDeviceEnvironments [0 ]);
175
177
@@ -184,7 +186,7 @@ TEST(IoctlHelperXeTest, givenEuDebugSysFsContentWhenItIsZeroThenEuDebugInterface
184
186
EXPECT_EQ (nullptr , euDebugInterface);
185
187
}
186
188
187
- TEST (IoctlHelperXeTest, givenInvalidPathWhenCreateEuDebugInterfaceThenReturnNullptr) {
189
+ TEST_F (IoctlHelperXeTest, givenInvalidPathWhenCreateEuDebugInterfaceThenReturnNullptr) {
188
190
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
189
191
auto drm = DrmMockXeDebug::create (*executionEnvironment->rootDeviceEnvironments [0 ]);
190
192
@@ -195,7 +197,7 @@ TEST(IoctlHelperXeTest, givenInvalidPathWhenCreateEuDebugInterfaceThenReturnNull
195
197
EXPECT_EQ (nullptr , euDebugInterface);
196
198
}
197
199
198
- TEST (IoctlHelperXeTest, whenEuDebugInterfaceIsCreatedThenEuDebugIsAvailable) {
200
+ TEST_F (IoctlHelperXeTest, whenEuDebugInterfaceIsCreatedThenEuDebugIsAvailable) {
199
201
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
200
202
auto drm = DrmMockXeDebug::create (*executionEnvironment->rootDeviceEnvironments [0 ]);
201
203
auto xeIoctlHelper = static_cast <MockIoctlHelperXeDebug *>(drm->ioctlHelper .get ());
@@ -206,7 +208,7 @@ TEST(IoctlHelperXeTest, whenEuDebugInterfaceIsCreatedThenEuDebugIsAvailable) {
206
208
EXPECT_EQ (1 , xeIoctlHelper->getEuDebugSysFsEnable ());
207
209
}
208
210
209
- TEST (IoctlHelperXeTest, givenXeRegisterResourceThenCorrectIoctlCalled) {
211
+ TEST_F (IoctlHelperXeTest, givenXeRegisterResourceThenCorrectIoctlCalled) {
210
212
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
211
213
auto drm = DrmMockXeDebug::create (*executionEnvironment->rootDeviceEnvironments [0 ]);
212
214
auto xeIoctlHelper = static_cast <MockIoctlHelperXeDebug *>(drm->ioctlHelper .get ());
@@ -256,15 +258,15 @@ TEST(IoctlHelperXeTest, givenXeRegisterResourceThenCorrectIoctlCalled) {
256
258
EXPECT_EQ (drm->metadataType , static_cast <uint64_t >(EuDebugParam::metadataModuleArea));
257
259
}
258
260
259
- TEST (IoctlHelperXeTest, givenXeunregisterResourceThenCorrectIoctlCalled) {
261
+ TEST_F (IoctlHelperXeTest, givenXeunregisterResourceThenCorrectIoctlCalled) {
260
262
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
261
263
auto drm = DrmMockXeDebug::create (*executionEnvironment->rootDeviceEnvironments [0 ]);
262
264
auto xeIoctlHelper = static_cast <MockIoctlHelperXeDebug *>(drm->ioctlHelper .get ());
263
265
xeIoctlHelper->unregisterResource (0x1234 );
264
266
EXPECT_EQ (drm->metadataID , 0x1234u );
265
267
}
266
268
267
- TEST (IoctlHelperXeTest, whenGettingVmBindExtFromHandlesThenProperStructsAreReturned) {
269
+ TEST_F (IoctlHelperXeTest, whenGettingVmBindExtFromHandlesThenProperStructsAreReturned) {
268
270
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
269
271
auto drm = DrmMockXeDebug::create (*executionEnvironment->rootDeviceEnvironments [0 ]);
270
272
auto xeIoctlHelper = static_cast <MockIoctlHelperXeDebug *>(drm->ioctlHelper .get ());
@@ -287,7 +289,7 @@ TEST(IoctlHelperXeTest, whenGettingVmBindExtFromHandlesThenProperStructsAreRetur
287
289
EXPECT_EQ (reinterpret_cast <uintptr_t >(&vmBindExt[2 ]), vmBindExt[1 ].base .nextExtension );
288
290
}
289
291
290
- TEST (IoctlHelperXeTest, givenResourceRegistrationEnabledWhenAllocationTypeShouldBeRegisteredThenBoHasBindExtHandleAdded) {
292
+ TEST_F (IoctlHelperXeTest, givenResourceRegistrationEnabledWhenAllocationTypeShouldBeRegisteredThenBoHasBindExtHandleAdded) {
291
293
const uint32_t rootDeviceIndex = 0u ;
292
294
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
293
295
DrmMockResources drm (*executionEnvironment->rootDeviceEnvironments [rootDeviceIndex]);
@@ -336,7 +338,7 @@ TEST(IoctlHelperXeTest, givenResourceRegistrationEnabledWhenAllocationTypeShould
336
338
}
337
339
}
338
340
339
- TEST (IoctlHelperXeTest, givenResourceRegistrationEnabledWhenAllocationTypeShouldNotBeRegisteredThenNoBindHandleCreated) {
341
+ TEST_F (IoctlHelperXeTest, givenResourceRegistrationEnabledWhenAllocationTypeShouldNotBeRegisteredThenNoBindHandleCreated) {
340
342
const uint32_t rootDeviceIndex = 0u ;
341
343
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
342
344
DrmMockResources drm (*executionEnvironment->rootDeviceEnvironments [rootDeviceIndex]);
@@ -356,7 +358,7 @@ TEST(IoctlHelperXeTest, givenResourceRegistrationEnabledWhenAllocationTypeShould
356
358
EXPECT_EQ (DrmResourceClass::maxSize, drm.registeredClass );
357
359
}
358
360
359
- TEST (IoctlHelperXeTest, givenDebuggingEnabledWhenCallingVmBindThenWaitUserFenceIsCalledWithCorrectTimeout) {
361
+ TEST_F (IoctlHelperXeTest, givenDebuggingEnabledWhenCallingVmBindThenWaitUserFenceIsCalledWithCorrectTimeout) {
360
362
361
363
DebugManagerStateRestore restorer;
362
364
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
0 commit comments