1# Copyright (c) 2021 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/test.gni")
15
16module_out_path = "graphic_2d/opengl_wrapper"
17
18group("unittest") {
19  testonly = true
20
21  deps = [ ":opengl_wrapper_unit_test" ]
22}
23
24group("blobunittest") {
25  testonly = true
26
27  deps = [ ":opengl_wrapper_blob_unit_test" ]
28}
29
30ohos_unittest("opengl_wrapper_unit_test") {
31  module_out_path = module_out_path
32  sources = [
33    "egl_bundle_mgr_helper_test.cpp",
34    "egl_core_test.cpp",
35    "egl_wrapper_context_test.cpp",
36    "egl_wrapper_display_test.cpp",
37    "egl_wrapper_entry_test.cpp",
38    "egl_wrapper_layer_test.cpp",
39    "egl_wrapper_loader_test.cpp",
40    "thread_private_data_ctl_test.cpp",
41  ]
42  deps = [ ":opengl_wrapper_test_common" ]
43
44  external_deps = [
45    "bundle_framework:appexecfwk_base",
46    "bundle_framework:appexecfwk_core",
47    "ipc:ipc_core",
48    "samgr:samgr_proxy",
49  ]
50}
51
52ohos_unittest("opengl_wrapper_blob_unit_test") {
53  module_out_path = module_out_path
54  sources = [ "egl_blob_test.cpp" ]
55  deps = [ ":opengl_wrapper_test_common" ]
56}
57
58config("opengl_wrapper_test_common_public_config") {
59  include_dirs = [
60    "//foundation/graphic/graphic_2d/frameworks/opengl_wrapper/src",
61    "//foundation/graphic/graphic_2d/frameworks/opengl_wrapper/src/EGL",
62  ]
63
64  cflags = [
65    "-Wall",
66    "-Werror",
67    "-g3",
68    "-Dprivate=public",
69    "-Dprotected=public",
70  ]
71}
72
73ohos_static_library("opengl_wrapper_test_common") {
74  visibility = [ ":*" ]
75  testonly = true
76
77  public_configs = [ ":opengl_wrapper_test_common_public_config" ]
78
79  public_deps = [
80    "//commonlibrary/c_utils/base:utils",
81    "//foundation/graphic/graphic_2d/frameworks/opengl_wrapper:EGL",
82    "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy",
83    "//third_party/googletest:gmock",
84    "//third_party/googletest:gtest_main",
85  ]
86
87  external_deps = [ "hilog:libhilog" ]
88  subsystem_name = "graphic"
89  part_name = "graphic_2d"
90}
91