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("../../../camera.gni")
15
16import("//build/ohos.gni")
17import("//build/test.gni")
18
19module_output_path = "drivers_peripheral_camera/camera"
20
21config("camhdi_at_test_config") {
22  visibility = [ ":*" ]
23  cflags_cc = [
24    "-DGST_DISABLE_DEPRECATED",
25    "-DHAVE_CONFIG_H",
26    "-DCOLORSPACE=\"videoconvert\"",
27  ]
28  if (enable_camera_coverage) {
29    cflags_cc += [ "--coverage" ]
30    ldflags = [ "--coverage" ]
31  }
32}
33
34ohos_unittest("camera_test_hdi_V1_3") {
35  testonly = true
36  module_out_path = module_output_path
37  sources = [
38    "$camera_common_path/v1_0/src/hdi_common.cpp",
39    "$camera_common_path/v1_1/src/hdi_common_v1_1.cpp",
40    "$camera_common_path/v1_2/src/hdi_common_v1_2.cpp",
41    "$camera_common_path/v1_3/src/hdi_common_v1_3.cpp",
42    "$camera_test_path/v1_3/src/camera_front_uttest_v1_3.cpp",
43    "$camera_test_path/v1_3/src/camera_hdi_tag_test_v1_3.cpp",
44    "$camera_test_path/v1_3/src/camera_hdi_uttest_securestream_v1_3.cpp",
45    "$camera_test_path/v1_3/src/camera_hdi_uttest_v1_3.cpp",
46    "$camera_test_path/v1_3/src/camera_professional_uttest_v1_3.cpp",
47  ]
48
49  include_dirs = [
50    # common includes
51    "$camera_common_path/v1_0/include",
52    "$camera_common_path/v1_1/include",
53    "$camera_common_path/v1_2/include",
54    "$camera_common_path/v1_3/include",
55    "$camera_test_path/v1_3/include",
56    "//third_party/googletest/googletest/include",
57    "$camera_path/../../../display/interfaces/include",
58    "$camera_path/../../../display/hdi_service/gralloc/include",
59    "$camera_path/../../interfaces/include",
60    "$camera_path/include",
61  ]
62
63  deps = [
64    "//third_party/googletest:gmock_main",
65    "//third_party/googletest:gtest",
66    "//third_party/googletest:gtest_main",
67  ]
68  defines = [ "CAMERA_UT_TEST" ]
69
70  if (is_standard_system) {
71    external_deps = [
72      "c_utils:utils",
73      "hdf_core:libhdf_host",
74      "hdf_core:libhdf_ipc_adapter",
75      "hdf_core:libhdf_utils",
76      "hdf_core:libhdi",
77      "hilog:libhilog",
78      "ipc:ipc_single",
79    ]
80  } else {
81    external_deps = [ "hilog:libhilog" ]
82  }
83
84  external_deps += [
85    "drivers_interface_camera:libbuffer_producer_sequenceable_1.0",
86    "drivers_interface_camera:libcamera_proxy_1.3",
87    "drivers_interface_camera:metadata",
88    "graphic_surface:surface",
89    "samgr:samgr_proxy",
90  ]
91  public_configs = [ ":camhdi_at_test_config" ]
92}
93