2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2021-05-17 02:51:16 +08:00
|
|
|
* Copyright (C) 2018-2021 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-10-16 17:58:36 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/helpers/hw_info.h"
|
|
|
|
#include "shared/source/os_interface/os_library.h"
|
2021-05-21 18:22:13 +08:00
|
|
|
#include "shared/test/common/mocks/mock_compilers.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
using namespace NEO;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-15 18:09:06 +08:00
|
|
|
OsLibrary *setAdapterInfo(const PLATFORM *platform, const GT_SYSTEM_INFO *gtSystemInfo, uint64_t gpuAddressSpace);
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
class TestEnvironment : public ::testing::Environment {
|
|
|
|
public:
|
|
|
|
TestEnvironment();
|
|
|
|
|
2020-03-12 16:45:33 +08:00
|
|
|
void SetUp() override;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-03-12 16:45:33 +08:00
|
|
|
void TearDown() override;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
virtual void fclPushDebugVars(
|
|
|
|
MockCompilerDebugVars &newDebugVars);
|
|
|
|
|
|
|
|
virtual void fclPopDebugVars();
|
|
|
|
|
|
|
|
virtual void igcPushDebugVars(
|
|
|
|
MockCompilerDebugVars &newDebugVars);
|
|
|
|
|
|
|
|
virtual void igcPopDebugVars();
|
|
|
|
|
|
|
|
virtual void setDefaultDebugVars(
|
|
|
|
MockCompilerDebugVars &fclDefaults,
|
|
|
|
MockCompilerDebugVars &igcDefaults,
|
|
|
|
HardwareInfo &hwInfo);
|
|
|
|
|
|
|
|
virtual void setMockFileNames(
|
|
|
|
std::string &fclMockFile,
|
|
|
|
std::string &igcMockFile);
|
|
|
|
|
|
|
|
virtual std::string &fclGetMockFile();
|
|
|
|
virtual std::string &igcGetMockFile();
|
|
|
|
|
|
|
|
protected:
|
2020-03-13 21:59:00 +08:00
|
|
|
OsLibrary *libraryFrontEnd = nullptr;
|
|
|
|
OsLibrary *libraryIGC = nullptr;
|
|
|
|
OsLibrary *libraryOS = nullptr;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
std::vector<MockCompilerDebugVars> igcDebugVarStack;
|
|
|
|
std::vector<MockCompilerDebugVars> fclDebugVarStack;
|
|
|
|
|
|
|
|
void (*igcSetDebugVarsFPtr)(MockCompilerDebugVars &debugVars);
|
|
|
|
void (*fclSetDebugVarsFptr)(MockCompilerDebugVars &debugVars);
|
|
|
|
|
2020-03-13 21:59:00 +08:00
|
|
|
MockCompilerDebugVars fclDefaultDebugVars{};
|
|
|
|
MockCompilerDebugVars igcDefaultDebugVars{};
|
|
|
|
HardwareInfo hwInfoDefaultDebugVars{};
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-03-13 21:59:00 +08:00
|
|
|
std::string fclMockFile{};
|
|
|
|
std::string igcMockFile{};
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-03-13 21:59:00 +08:00
|
|
|
MockCompilerEnableGuard mockCompilerGuard{};
|
2017-12-21 07:45:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
extern TestEnvironment *gEnvironment;
|