mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +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,7 +9,6 @@ set(IGDRCL_SRCS_tests_os_interface_base
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/device_factory_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_performance_counters.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_performance_counters.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_interface_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/performance_counters_tests.cpp
|
||||
)
|
||||
|
||||
|
@ -1,22 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
TEST(OSInterface, WhenInterfaceIsCreatedThenItIsNonCopyable) {
|
||||
EXPECT_FALSE(std::is_move_constructible<NEO::OSInterface>::value);
|
||||
EXPECT_FALSE(std::is_copy_constructible<NEO::OSInterface>::value);
|
||||
}
|
||||
|
||||
TEST(OSInterface, WhenInterfaceIsCreatedThenItIsNonAssignable) {
|
||||
EXPECT_FALSE(std::is_move_assignable<NEO::OSInterface>::value);
|
||||
EXPECT_FALSE(std::is_copy_assignable<NEO::OSInterface>::value);
|
||||
}
|
@ -6,7 +6,6 @@
|
||||
|
||||
set(IGDRCL_SRCS_tests_os_interface_windows
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/device_command_stream_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/device_os_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/driver_info_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/file_logger_win_tests.cpp
|
||||
@ -14,8 +13,6 @@ set(IGDRCL_SRCS_tests_os_interface_windows
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_os_time_win.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_performance_counters_win.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_performance_counters_win.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_interface_win_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_interface_win_tests.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_time_win_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/performance_counters_win_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/registry_reader_tests.cpp
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
namespace NEO {
|
||||
@ -124,4 +125,10 @@ class OSInterface : public NonCopyableClass {
|
||||
protected:
|
||||
std::unique_ptr<DriverModel> driverModel = nullptr;
|
||||
};
|
||||
|
||||
static_assert(!std::is_move_constructible_v<NEO::OSInterface>);
|
||||
static_assert(!std::is_copy_constructible_v<NEO::OSInterface>);
|
||||
static_assert(!std::is_move_assignable_v<NEO::OSInterface>);
|
||||
static_assert(!std::is_copy_assignable_v<NEO::OSInterface>);
|
||||
|
||||
} // namespace NEO
|
||||
|
@ -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
|
||||
|
@ -44,8 +44,6 @@
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
#include "shared/test/unit_test/fixtures/mock_aub_center_fixture.h"
|
||||
|
||||
#include "opencl/test/unit_test/mocks/mock_buffer.h"
|
||||
|
||||
#include "hw_cmds.h"
|
||||
|
||||
using namespace NEO;
|
||||
@ -680,17 +678,17 @@ TEST_F(WddmCommandStreamTest, WhenProcesssingEvictionThenEvictionAllocationsList
|
||||
|
||||
TEST_F(WddmCommandStreamTest, WhenMakingResidentAndNonResidentThenAllocationIsMovedCorrectly) {
|
||||
GraphicsAllocation *gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize});
|
||||
Buffer *buffer = new AlignedBuffer(gfxAllocation);
|
||||
|
||||
csr->makeResident(*buffer->getGraphicsAllocation(csr->getRootDeviceIndex()));
|
||||
ASSERT_NE(gfxAllocation, nullptr);
|
||||
|
||||
csr->makeResident(*gfxAllocation);
|
||||
EXPECT_EQ(0u, wddm->makeResidentResult.called);
|
||||
EXPECT_EQ(1u, csr->getResidencyAllocations().size());
|
||||
EXPECT_EQ(gfxAllocation, csr->getResidencyAllocations()[0]);
|
||||
|
||||
csr->makeNonResident(*buffer->getGraphicsAllocation(csr->getRootDeviceIndex()));
|
||||
csr->makeNonResident(*gfxAllocation);
|
||||
EXPECT_EQ(gfxAllocation, csr->getEvictionAllocations()[0]);
|
||||
|
||||
delete buffer;
|
||||
memoryManager->freeGraphicsMemory(gfxAllocation);
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/test/unit_test/os_interface/windows/os_interface_win_tests.h"
|
||||
#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"
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
Reference in New Issue
Block a user