Move shared mocks to shared directory

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2021-12-21 11:53:21 +00:00
committed by Compute-Runtime-Automation
parent 52f23f9768
commit 4176cac845
53 changed files with 67 additions and 76 deletions

View File

@@ -0,0 +1,25 @@
/*
* Copyright (C) 2019-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/test/common/fixtures/device_fixture.h"
#include "shared/test/unit_test/fixtures/mock_aub_center_fixture.h"
namespace NEO {
struct AubCommandStreamReceiverFixture : public DeviceFixture, MockAubCenterFixture {
void SetUp() {
DeviceFixture::SetUp();
MockAubCenterFixture::SetUp();
setMockAubCenter(*pDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]);
}
void TearDown() {
MockAubCenterFixture::TearDown();
DeviceFixture::TearDown();
}
};
} // namespace NEO

View File

@@ -0,0 +1,29 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/test/common/fixtures/tbx_command_stream_fixture.h"
#include "shared/source/command_stream/command_stream_receiver.h"
#include "shared/source/command_stream/tbx_command_stream_receiver_hw.h"
#include "shared/test/common/mocks/mock_device.h"
#include "gtest/gtest.h"
namespace NEO {
void TbxCommandStreamFixture::SetUp(MockDevice *pDevice) {
// Create our TBX command stream receiver based on HW type
pCommandStreamReceiver = TbxCommandStreamReceiver::create("", false, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
ASSERT_NE(nullptr, pCommandStreamReceiver);
memoryManager = new OsAgnosticMemoryManager(*pDevice->executionEnvironment);
pDevice->resetCommandStreamReceiver(pCommandStreamReceiver);
}
void TbxCommandStreamFixture::TearDown() {
delete memoryManager;
}
} // namespace NEO

View File

@@ -0,0 +1,25 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
namespace NEO {
class CommandStreamReceiver;
class MockDevice;
class MemoryManager;
class TbxCommandStreamFixture {
public:
void SetUp(MockDevice *pDevice);
void TearDown();
CommandStreamReceiver *pCommandStreamReceiver = nullptr;
MemoryManager *memoryManager = nullptr;
};
} // namespace NEO