mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-11 16:45:25 +08:00
Move shared mocks to shared directory
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
52f23f9768
commit
4176cac845
@@ -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
|
||||
29
shared/test/common/fixtures/tbx_command_stream_fixture.cpp
Normal file
29
shared/test/common/fixtures/tbx_command_stream_fixture.cpp
Normal 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
|
||||
25
shared/test/common/fixtures/tbx_command_stream_fixture.h
Normal file
25
shared/test/common/fixtures/tbx_command_stream_fixture.h
Normal 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
|
||||
Reference in New Issue
Block a user