• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
13import("//build/test.gni")
14import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni")
15
16module_output_path = "hdf/codec"
17
18ohos_unittest("codec_hdi_1.0_test") {
19  module_out_path = module_output_path
20  CODEC_OEM_PATH = rebase_path(
21          "//device/soc/${device_company}/${product_name}/hardware/codec")
22  cmd = "if [ -f ${CODEC_OEM_PATH}/BUILD.gn ]; then echo true; else echo false; fi"
23  HAVE_CODEC_OEM_PATH =
24      exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value")
25
26  if (HAVE_CODEC_OEM_PATH) {
27    include_dirs = [
28      "${CODEC_OEM_PATH}/include",
29      "//drivers/peripheral/codec/interfaces/include",
30      "//drivers/peripheral/codec/hdi_service/codec_proxy",
31      "//drivers/peripheral/codec/hdi_service/codec_service_stub",
32      "//drivers/peripheral/codec/hal/v1.0/share_mem/include",
33    ]
34    sources = [ "codec_proxy_test.cpp" ]
35  }
36
37  cflags = [
38    "-Wall",
39    "-Wextra",
40    "-Werror",
41    "-fsigned-char",
42    "-fno-common",
43    "-fno-strict-aliasing",
44  ]
45
46  deps = [
47    "//drivers/peripheral/codec/hdi_service:codec_client",
48    "//drivers/peripheral/codec/hdi_service:codec_service",
49    "//third_party/googletest:gtest_main",
50  ]
51
52  if (is_standard_system) {
53    external_deps = [
54      "c_utils:utils",
55      "drivers_peripheral_display:hdi_gralloc_client",
56      "graphic_chipsetsdk:buffer_handle",
57      "hdf_core:libhdf_host",
58      "hdf_core:libhdf_ipc_adapter",
59      "hdf_core:libhdf_utils",
60      "hdf_core:libhdi",
61      "hiviewdfx_hilog_native:libhilog",
62    ]
63  } else {
64    external_deps = [ "hilog:libhilog" ]
65  }
66}
67
68group("codec_client_test") {
69  testonly = true
70  deps = [ ":codec_hdi_1.0_test" ]
71}
72