mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Fail AUB tests execution if AUB file cannot be created
Change-Id: Id0474cc5c00be90e69d498ec5674089086a82350 Signed-off-by: Pawel Wilma <pawel.wilma@intel.com>
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
|
||||
set(IGDRCL_SRCS_tests_fixtures
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/aub_command_stream_receiver_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/buffer_enqueue_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/context_fixture.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/context_fixture.h
|
||||
@ -28,6 +29,7 @@ set(IGDRCL_SRCS_tests_fixtures
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/memory_allocator_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/memory_manager_fixture.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/memory_manager_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_aub_center_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/platform_fixture.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/platform_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/preemption_fixture.cpp
|
||||
|
25
unit_tests/fixtures/aub_command_stream_receiver_fixture.h
Normal file
25
unit_tests/fixtures/aub_command_stream_receiver_fixture.h
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
#include "unit_tests/fixtures/mock_aub_center_fixture.h"
|
||||
|
||||
namespace NEO {
|
||||
struct AubCommandStreamReceiverFixture : public DeviceFixture, MockAubCenterFixture {
|
||||
void SetUp() {
|
||||
DeviceFixture::SetUp();
|
||||
MockAubCenterFixture::SetUp();
|
||||
setMockAubCenter(pDevice->getExecutionEnvironment());
|
||||
}
|
||||
void TearDown() {
|
||||
MockAubCenterFixture::TearDown();
|
||||
DeviceFixture::TearDown();
|
||||
}
|
||||
};
|
||||
} // namespace NEO
|
42
unit_tests/fixtures/mock_aub_center_fixture.h
Normal file
42
unit_tests/fixtures/mock_aub_center_fixture.h
Normal file
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "runtime/execution_environment/execution_environment.h"
|
||||
#include "runtime/platform/platform.h"
|
||||
#include "unit_tests/mocks/mock_aub_center.h"
|
||||
#include "unit_tests/mocks/mock_aub_manager.h"
|
||||
#include "unit_tests/tests_configuration.h"
|
||||
|
||||
namespace NEO {
|
||||
struct MockAubCenterFixture {
|
||||
|
||||
MockAubCenterFixture() = default;
|
||||
MockAubCenterFixture(CommandStreamReceiverType commandStreamReceiverType) : commandStreamReceiverType(commandStreamReceiverType){};
|
||||
|
||||
void SetUp() {
|
||||
setMockAubCenter(platformImpl->peekExecutionEnvironment(), commandStreamReceiverType);
|
||||
}
|
||||
void TearDown() {
|
||||
}
|
||||
|
||||
static void setMockAubCenter(ExecutionEnvironment *executionEnvironment) {
|
||||
setMockAubCenter(executionEnvironment, CommandStreamReceiverType::CSR_AUB);
|
||||
}
|
||||
static void setMockAubCenter(ExecutionEnvironment *executionEnvironment, CommandStreamReceiverType commandStreamReceiverType) {
|
||||
if (testMode != TestMode::AubTests && testMode != TestMode::AubTestsWithTbx) {
|
||||
auto mockAubCenter = std::make_unique<MockAubCenter>(platformDevices[0], false, "", commandStreamReceiverType);
|
||||
mockAubCenter->aubManager = std::make_unique<MockAubManager>();
|
||||
executionEnvironment->aubCenter.reset(mockAubCenter.release());
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
CommandStreamReceiverType commandStreamReceiverType = CommandStreamReceiverType::CSR_AUB;
|
||||
};
|
||||
} // namespace NEO
|
Reference in New Issue
Block a user