Skip to content

Commit 3c27e97

Browse files
Extract gl mocks to windows directory
Change-Id: I963032bfad880e42100f6233b9570cefb607f26c
1 parent 054f2b5 commit 3c27e97

20 files changed

+79
-50
lines changed

unit_tests/api/gl/cl_create_from_gl_texture_tests.cpp

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

88
#include "unit_tests/api/cl_api_tests.h"
9-
#include "unit_tests/mocks/gl/mock_gl_sharing.h"
9+
10+
#include <GL/gl.h>
1011

1112
using namespace NEO;
1213

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
#
2-
# Copyright (C) 2017-2018 Intel Corporation
2+
# Copyright (C) 2017-2020 Intel Corporation
33
#
44
# SPDX-License-Identifier: MIT
55
#
66

7-
if(WIN32)
8-
set(IGDRCL_SRCS_tests_command_queue_gl
9-
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
10-
${CMAKE_CURRENT_SOURCE_DIR}/enqueue_kernel_gl_tests.cpp
11-
)
12-
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_command_queue_gl})
13-
endif()
7+
add_subdirectories()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Copyright (C) 2020 Intel Corporation
3+
#
4+
# SPDX-License-Identifier: MIT
5+
#
6+
7+
if(WIN32)
8+
set(IGDRCL_SRCS_tests_command_queue_gl_windows
9+
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
10+
${CMAKE_CURRENT_SOURCE_DIR}/enqueue_kernel_gl_tests_windows.cpp
11+
)
12+
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_command_queue_gl_windows})
13+
endif()

unit_tests/command_queue/gl/enqueue_kernel_gl_tests.cpp renamed to unit_tests/command_queue/gl/windows/enqueue_kernel_gl_tests_windows.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "unit_tests/fixtures/hello_world_fixture.h"
1515
#include "unit_tests/fixtures/memory_management_fixture.h"
1616
#include "unit_tests/helpers/hw_parse.h"
17-
#include "unit_tests/mocks/gl/mock_gl_sharing.h"
17+
#include "unit_tests/mocks/gl/windows/mock_gl_sharing_windows.h"
1818
#include "unit_tests/mocks/mock_buffer.h"
1919
#include "unit_tests/mocks/mock_csr.h"
2020
#include "unit_tests/mocks/mock_submissions_aggregator.h"

unit_tests/mock_gl/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#
2+
# Copyright (C) 2020 Intel Corporation
3+
#
4+
# SPDX-License-Identifier: MIT
5+
#
6+
7+
add_subdirectories()
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#
2+
# Copyright (C) 2017-2020 Intel Corporation
3+
#
4+
# SPDX-License-Identifier: MIT
5+
#
6+
7+
if(WIN32)
8+
set(IGDRCL_SRCS_mock_opengl32
9+
${CMAKE_CURRENT_SOURCE_DIR}/mock_opengl32.cpp
10+
${CMAKE_CURRENT_SOURCE_DIR}/mock_opengl32.def
11+
${NEO_SOURCE_DIR}/unit_tests/helpers/windows/mock_function.cpp
12+
)
13+
14+
add_library(mock_opengl32 SHARED ${IGDRCL_SRCS_mock_opengl32})
15+
add_dependencies(unit_tests mock_opengl32)
16+
add_dependencies(igdrcl_tests mock_opengl32)
17+
set_target_properties(mock_opengl32 PROPERTIES FOLDER "test mocks")
18+
target_include_directories(mock_opengl32 PRIVATE $<TARGET_PROPERTY:${NEO_MOCKABLE_LIB_NAME},INTERFACE_INCLUDE_DIRECTORIES>)
19+
target_compile_definitions(mock_opengl32 PRIVATE $<TARGET_PROPERTY:${NEO_MOCKABLE_LIB_NAME},INTERFACE_COMPILE_DEFINITIONS>)
20+
endif()
21+

unit_tests/mocks/gl/mock_opengl32.cpp renamed to unit_tests/mock_gl/windows/mock_opengl32.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2019 Intel Corporation
2+
* Copyright (C) 2018-2020 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -8,7 +8,7 @@
88
#define _GDI32_ //It causes that definitions of functions are not loaded from dll in file wingdi.h because they are in this file.
99

1010
#include "unit_tests/helpers/windows/mock_function.h"
11-
#include "unit_tests/mocks/gl/mock_gl_sharing.h"
11+
#include "unit_tests/mocks/gl/windows/mock_gl_sharing_windows.h"
1212

1313
#include "GL/gl.h"
1414

unit_tests/mocks/gl/mock_opengl32.def renamed to unit_tests/mock_gl/windows/mock_opengl32.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; Copyright (c) 2017, Intel Corporation
1+
; Copyright (c) 2017-2020, Intel Corporation
22
;
33
; Permission is hereby granted, free of charge, to any person obtaining a
44
; copy of this software and associated documentation files (the "Software"),

unit_tests/mocks/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,8 @@ else()
102102
)
103103
endif()
104104

105-
add_subdirectories()
106-
107105
add_library(igdrcl_mocks STATIC EXCLUDE_FROM_ALL ${IGDRCL_SRCS_tests_mocks})
106+
add_subdirectories()
108107

109108
if(WIN32)
110109
target_include_directories(igdrcl_mocks PUBLIC

unit_tests/mocks/gl/CMakeLists.txt

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,7 @@
11
#
2-
# Copyright (C) 2017-2019 Intel Corporation
2+
# Copyright (C) 2017-2020 Intel Corporation
33
#
44
# SPDX-License-Identifier: MIT
55
#
66

7-
if(WIN32)
8-
list (APPEND IGDRCL_SRCS_tests_mocks
9-
${CMAKE_CURRENT_SOURCE_DIR}/mock_gl_sharing.cpp
10-
${CMAKE_CURRENT_SOURCE_DIR}/mock_gl_sharing.h
11-
${CMAKE_CURRENT_SOURCE_DIR}/mock_gl_arb_sync_event.h
12-
)
13-
14-
set(IGDRCL_SRCS_tests_mocks "${IGDRCL_SRCS_tests_mocks}" PARENT_SCOPE)
15-
16-
set(IGDRCL_SRCS_mock_opengl32
17-
${CMAKE_CURRENT_SOURCE_DIR}/mock_opengl32.cpp
18-
${CMAKE_CURRENT_SOURCE_DIR}/mock_opengl32.def
19-
${NEO_SOURCE_DIR}/unit_tests/helpers/windows/mock_function.cpp
20-
)
21-
22-
add_library(mock_opengl32 SHARED ${IGDRCL_SRCS_mock_opengl32})
23-
add_dependencies(unit_tests mock_opengl32)
24-
add_dependencies(igdrcl_tests mock_opengl32)
25-
set_target_properties(mock_opengl32 PROPERTIES FOLDER "test mocks")
26-
target_include_directories(mock_opengl32 PRIVATE $<TARGET_PROPERTY:${NEO_MOCKABLE_LIB_NAME},INTERFACE_INCLUDE_DIRECTORIES>)
27-
target_compile_definitions(mock_opengl32 PRIVATE $<TARGET_PROPERTY:${NEO_MOCKABLE_LIB_NAME},INTERFACE_COMPILE_DEFINITIONS>)
28-
endif()
29-
7+
add_subdirectories()

0 commit comments

Comments
 (0)