mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 14:33:04 +08:00
Move some os_interface tests to shared
Signed-off-by: Daniel Chabrowski <daniel.chabrowski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
9a8f2bb835
commit
b5ee204d9c
@@ -9,11 +9,14 @@ set(NEO_CORE_OS_INTERFACE_TESTS_WINDOWS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/adapter_info_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/adapter_info_tests.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/deferrable_deletion_win_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/device_command_stream_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gdi_interface_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gmm_helper_tests_win.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_win_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_win_tests.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_context_win_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_interface_win_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_interface_win_tests.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_library_win_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/self_lib_win.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/um_km_data_translator_tests.cpp
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/unit_test/os_interface/windows/os_interface_win_tests.h"
|
||||
|
||||
#include "shared/source/execution_environment/root_device_environment.h"
|
||||
#include "shared/source/os_interface/windows/os_context_win.h"
|
||||
#include "shared/source/os_interface/windows/sys_calls.h"
|
||||
#include "shared/test/common/helpers/engine_descriptor_helper.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
#include "shared/test/common/os_interface/windows/wddm_fixture.h"
|
||||
|
||||
TEST_F(OsInterfaceTest, GivenWindowsWhenOsSupportFor64KBpagesIsBeingQueriedThenTrueIsReturned) {
|
||||
EXPECT_TRUE(OSInterface::are64kbPagesEnabled());
|
||||
}
|
||||
|
||||
TEST_F(OsInterfaceTest, GivenWindowsWhenCreateEentIsCalledThenValidEventHandleIsReturned) {
|
||||
auto ev = NEO::SysCalls::createEvent(NULL, TRUE, FALSE, "DUMMY_EVENT_NAME");
|
||||
EXPECT_NE(nullptr, ev);
|
||||
auto ret = NEO::SysCalls::closeHandle(ev);
|
||||
EXPECT_EQ(TRUE, ret);
|
||||
}
|
||||
|
||||
TEST(OsContextTest, givenWddmWhenCreateOsContextAfterInitWddmThenOsContextIsInitializedTrimCallbackIsRegisteredMemoryOperationsHandlerCreated) {
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
RootDeviceEnvironment rootDeviceEnvironment(executionEnvironment);
|
||||
auto wddm = new WddmMock(rootDeviceEnvironment);
|
||||
auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo);
|
||||
wddm->init();
|
||||
EXPECT_EQ(0u, wddm->registerTrimCallbackResult.called);
|
||||
auto osContext = std::make_unique<OsContextWin>(*wddm, 0u,
|
||||
EngineDescriptorHelper::getDefaultDescriptor(HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0], preemptionMode));
|
||||
osContext->ensureContextInitialized();
|
||||
EXPECT_EQ(osContext->getWddm(), wddm);
|
||||
EXPECT_EQ(1u, wddm->registerTrimCallbackResult.called);
|
||||
}
|
||||
|
||||
TEST_F(OsInterfaceTest, GivenWindowsOsWhenCheckForNewResourceImplicitFlushSupportThenReturnFalse) {
|
||||
EXPECT_FALSE(OSInterface::newResourceImplicitFlush);
|
||||
}
|
||||
|
||||
TEST_F(OsInterfaceTest, GivenWindowsOsWhenCheckForGpuIdleImplicitFlushSupportThenReturnFalse) {
|
||||
EXPECT_FALSE(OSInterface::gpuIdleImplicitFlush);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
#include "shared/source/os_interface/device_factory.h"
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/source/os_interface/windows/wddm/wddm.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
class OsInterfaceTest : public ::testing::Test {
|
||||
public:
|
||||
void SetUp() override {
|
||||
osInterface = std::unique_ptr<OSInterface>(new OSInterface());
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
}
|
||||
|
||||
std::unique_ptr<OSInterface> osInterface;
|
||||
};
|
||||
Reference in New Issue
Block a user