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:
Pawel Wilma
2019-03-19 11:57:45 +01:00
committed by sys_ocldev
parent 96db96fcb4
commit af64a54a88
17 changed files with 175 additions and 116 deletions

View File

@ -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

View 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

View 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