Skip to content

Commit b5ee204

Browse files
Move some os_interface tests to shared
Signed-off-by: Daniel Chabrowski <[email protected]>
1 parent 9a8f2bb commit b5ee204

File tree

8 files changed

+17
-35
lines changed

8 files changed

+17
-35
lines changed

opencl/test/unit_test/os_interface/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ set(IGDRCL_SRCS_tests_os_interface_base
99
${CMAKE_CURRENT_SOURCE_DIR}/device_factory_tests.cpp
1010
${CMAKE_CURRENT_SOURCE_DIR}/mock_performance_counters.cpp
1111
${CMAKE_CURRENT_SOURCE_DIR}/mock_performance_counters.h
12-
${CMAKE_CURRENT_SOURCE_DIR}/os_interface_tests.cpp
1312
${CMAKE_CURRENT_SOURCE_DIR}/performance_counters_tests.cpp
1413
)
1514

opencl/test/unit_test/os_interface/os_interface_tests.cpp

Lines changed: 0 additions & 22 deletions
This file was deleted.

opencl/test/unit_test/os_interface/windows/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@
66

77
set(IGDRCL_SRCS_tests_os_interface_windows
88
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
9-
${CMAKE_CURRENT_SOURCE_DIR}/device_command_stream_tests.cpp
109
${CMAKE_CURRENT_SOURCE_DIR}/device_os_tests.cpp
1110
${CMAKE_CURRENT_SOURCE_DIR}/driver_info_tests.cpp
1211
${CMAKE_CURRENT_SOURCE_DIR}/file_logger_win_tests.cpp
1312
${CMAKE_CURRENT_SOURCE_DIR}/mock_kmdaf_listener.h
1413
${CMAKE_CURRENT_SOURCE_DIR}/mock_os_time_win.h
1514
${CMAKE_CURRENT_SOURCE_DIR}/mock_performance_counters_win.cpp
1615
${CMAKE_CURRENT_SOURCE_DIR}/mock_performance_counters_win.h
17-
${CMAKE_CURRENT_SOURCE_DIR}/os_interface_win_tests.cpp
18-
${CMAKE_CURRENT_SOURCE_DIR}/os_interface_win_tests.h
1916
${CMAKE_CURRENT_SOURCE_DIR}/os_time_win_tests.cpp
2017
${CMAKE_CURRENT_SOURCE_DIR}/performance_counters_win_tests.cpp
2118
${CMAKE_CURRENT_SOURCE_DIR}/registry_reader_tests.cpp

shared/source/os_interface/os_interface.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <cstdint>
1515
#include <limits>
1616
#include <memory>
17+
#include <type_traits>
1718
#include <vector>
1819

1920
namespace NEO {
@@ -124,4 +125,10 @@ class OSInterface : public NonCopyableClass {
124125
protected:
125126
std::unique_ptr<DriverModel> driverModel = nullptr;
126127
};
128+
129+
static_assert(!std::is_move_constructible_v<NEO::OSInterface>);
130+
static_assert(!std::is_copy_constructible_v<NEO::OSInterface>);
131+
static_assert(!std::is_move_assignable_v<NEO::OSInterface>);
132+
static_assert(!std::is_copy_assignable_v<NEO::OSInterface>);
133+
127134
} // namespace NEO

shared/test/unit_test/os_interface/windows/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@ set(NEO_CORE_OS_INTERFACE_TESTS_WINDOWS
99
${CMAKE_CURRENT_SOURCE_DIR}/adapter_info_tests.cpp
1010
${CMAKE_CURRENT_SOURCE_DIR}/adapter_info_tests.h
1111
${CMAKE_CURRENT_SOURCE_DIR}/deferrable_deletion_win_tests.cpp
12+
${CMAKE_CURRENT_SOURCE_DIR}/device_command_stream_tests.cpp
1213
${CMAKE_CURRENT_SOURCE_DIR}/gdi_interface_tests.cpp
1314
${CMAKE_CURRENT_SOURCE_DIR}/gmm_helper_tests_win.cpp
1415
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_win_tests.cpp
1516
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_win_tests.h
1617
${CMAKE_CURRENT_SOURCE_DIR}/os_context_win_tests.cpp
18+
${CMAKE_CURRENT_SOURCE_DIR}/os_interface_win_tests.cpp
19+
${CMAKE_CURRENT_SOURCE_DIR}/os_interface_win_tests.h
1720
${CMAKE_CURRENT_SOURCE_DIR}/os_library_win_tests.cpp
1821
${CMAKE_CURRENT_SOURCE_DIR}/self_lib_win.cpp
1922
${CMAKE_CURRENT_SOURCE_DIR}/um_km_data_translator_tests.cpp

opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp renamed to shared/test/unit_test/os_interface/windows/device_command_stream_tests.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@
4444
#include "shared/test/common/test_macros/test.h"
4545
#include "shared/test/unit_test/fixtures/mock_aub_center_fixture.h"
4646

47-
#include "opencl/test/unit_test/mocks/mock_buffer.h"
48-
4947
#include "hw_cmds.h"
5048

5149
using namespace NEO;
@@ -680,17 +678,17 @@ TEST_F(WddmCommandStreamTest, WhenProcesssingEvictionThenEvictionAllocationsList
680678

681679
TEST_F(WddmCommandStreamTest, WhenMakingResidentAndNonResidentThenAllocationIsMovedCorrectly) {
682680
GraphicsAllocation *gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize});
683-
Buffer *buffer = new AlignedBuffer(gfxAllocation);
684681

685-
csr->makeResident(*buffer->getGraphicsAllocation(csr->getRootDeviceIndex()));
682+
ASSERT_NE(gfxAllocation, nullptr);
683+
684+
csr->makeResident(*gfxAllocation);
686685
EXPECT_EQ(0u, wddm->makeResidentResult.called);
687686
EXPECT_EQ(1u, csr->getResidencyAllocations().size());
688687
EXPECT_EQ(gfxAllocation, csr->getResidencyAllocations()[0]);
689688

690-
csr->makeNonResident(*buffer->getGraphicsAllocation(csr->getRootDeviceIndex()));
689+
csr->makeNonResident(*gfxAllocation);
691690
EXPECT_EQ(gfxAllocation, csr->getEvictionAllocations()[0]);
692691

693-
delete buffer;
694692
memoryManager->freeGraphicsMemory(gfxAllocation);
695693
}
696694

opencl/test/unit_test/os_interface/windows/os_interface_win_tests.cpp renamed to shared/test/unit_test/os_interface/windows/os_interface_win_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright (C) 2018-2021 Intel Corporation
2+
* Copyright (C) 2018-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

8-
#include "opencl/test/unit_test/os_interface/windows/os_interface_win_tests.h"
8+
#include "shared/test/unit_test/os_interface/windows/os_interface_win_tests.h"
99

1010
#include "shared/source/execution_environment/root_device_environment.h"
1111
#include "shared/source/os_interface/windows/os_context_win.h"

opencl/test/unit_test/os_interface/windows/os_interface_win_tests.h renamed to shared/test/unit_test/os_interface/windows/os_interface_win_tests.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2021 Intel Corporation
2+
* Copyright (C) 2018-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*

0 commit comments

Comments
 (0)