1# Copyright (c) 2024 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")
15import("//foundation/graphic/graphic_2d/graphic_config.gni")
16
17module_out_path = "graphic_2d/create_pixelmap_surface"
18
19group("unittest") {
20  testonly = true
21
22  deps = [ ":pixel_map_from_surface_test" ]
23}
24
25## UnitTest pixel_map_from_surface_test {{{
26ohos_unittest("pixel_map_from_surface_test") {
27  module_out_path = module_out_path
28
29  sources = [ "pixel_map_from_surface_test.cpp" ]
30
31  deps = [ ":pixel_map_test_common" ]
32}
33
34## UnitTest pixel_map_from_surface_test }}}
35
36## Build pixel_map_test_common.a {{{
37config("pixel_map_test_common_public_config") {
38  include_dirs = [
39    "$graphic_2d_root/interfaces/inner_api/common",
40    "$graphic_2d_root/rosen/modules/create_pixelmap_surface/include",
41  ]
42
43  cflags = [
44    "-Wall",
45    "-Werror",
46    "-g3",
47    "-Dprivate=public",
48    "-Dprotected=public",
49  ]
50}
51
52ohos_static_library("pixel_map_test_common") {
53  visibility = [ ":*" ]
54  testonly = true
55  sanitize = {
56    cfi = true
57    cfi_cross_dso = true
58    cfi_vcall_icall_only = true
59    debug = false
60  }
61  public_configs = [ ":pixel_map_test_common_public_config" ]
62
63  public_deps = [
64    "$graphic_2d_root/rosen/modules/create_pixelmap_surface:create_pixelmap_surface",
65    "//third_party/googletest:gmock_main",
66    "//third_party/googletest:gtest_main",
67  ]
68
69  public_external_deps = [
70    "c_utils:utils",
71    "graphic_surface:surface",
72    "image_framework:image_native",
73  ]
74
75  subsystem_name = "graphic"
76  part_name = "graphic_2d"
77}
78## Build pixel_map_test_common.a }}}
79