Refactor variables to modify getDevices func behavior

store them in one struct
expect that global state is restored on test end

Related-To: NEO-4207

Change-Id: Icd1db59598f464a34608290d6023405cf7f246f0
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2020-02-03 13:19:12 +01:00
committed by sys_ocldev
parent e631899fba
commit 10db7e0328
33 changed files with 130 additions and 93 deletions

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2019 Intel Corporation
# Copyright (C) 2019-2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
@@ -15,6 +15,8 @@ set(NEO_CORE_HELPERS_TESTS
${CMAKE_CURRENT_SOURCE_DIR}/simd_helper_tests.inl
${CMAKE_CURRENT_SOURCE_DIR}/string_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/string_to_hash_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ult_hw_config.h
${CMAKE_CURRENT_SOURCE_DIR}/ult_hw_config.inl
)
set_property(GLOBAL PROPERTY NEO_CORE_HELPERS_TESTS ${NEO_CORE_HELPERS_TESTS})

View File

@@ -0,0 +1,18 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
namespace NEO {
struct UltHwConfig {
bool mockedGetDevicesFuncResult = true;
bool useHwCsr = false;
bool useMockedGetDevicesFunc = true;
bool forceOsAgnosticMemoryManager = true;
};
extern UltHwConfig ultHwConfig;
} // namespace NEO

View File

@@ -0,0 +1,12 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "core/unit_tests/helpers/ult_hw_config.h"
namespace NEO {
UltHwConfig ultHwConfig{};
} // namespace NEO