• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2023 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("./../../uhdf.gni")
16
17hdf_framework_path = "./../../../../framework"
18hdf_uhdf_path = "./../.."
19hdf_interface_path = "./../../../../interface"
20
21###########################palTest###########################
22ohos_unittest("DevMgrTest") {
23  module_out_path = "hdf_core/hdf_core"
24  sources = [
25    "$hdf_uhdf_path/ipc/src/hdf_dump.cpp",
26    "unittest/devmgr_test.cpp",
27  ]
28
29  include_dirs = [
30    "$hdf_framework_path/include/osal",
31    "$hdf_framework_path/include/utils",
32    "$hdf_framework_path/utils/include",
33    "$hdf_uhdf_path/hdi/include",
34    "$hdf_uhdf_path/include/hidl",
35    "$hdf_uhdf_path/ipc/include",
36    "$hdf_interface_path/inner_api/ipc",
37    "unittest/common/",
38  ]
39
40  deps = [
41    "$hdf_uhdf_path/hdi:libhdi",
42    "$hdf_uhdf_path/utils:libhdf_utils",
43  ]
44
45  if (with_sample) {
46    defines = [ "SAMPLE_DRIVER" ]
47    deps += [ "$hdf_uhdf_path/host/test/unittest/sample_driver:sample_driver" ]
48  }
49
50  if (is_standard_system) {
51    external_deps = [
52      "c_utils:utils",
53      "hilog:libhilog",
54      "ipc:ipc_core",
55      "ipc:ipc_single",
56    ]
57  } else {
58    external_deps = [ "hilog:libhilog" ]
59  }
60
61  external_deps += [
62    "googletest:gmock_main",
63    "googletest:gtest_main",
64  ]
65}
66
67ohos_unittest("DevHostTest") {
68  module_out_path = "hdf_core/hdf_core"
69  sources = [ "unittest/devhost_test.cpp" ]
70
71  include_dirs = [
72    "$hdf_framework_path/core/shared/include",
73    "$hdf_framework_path/core/manager/include",
74    "$hdf_framework_path/include/osal",
75    "$hdf_framework_path/include/utils",
76    "$hdf_framework_path/utils/include",
77    "$hdf_framework_path/core/host/include",
78    "$hdf_uhdf_path/host/include",
79    "$hdf_uhdf_path/manager/include",
80    "$hdf_uhdf_path/ipc/include",
81  ]
82
83  defines = [ "__USER__" ]
84
85  deps = [
86    "$hdf_uhdf_path/host:libhdf_host",
87    "$hdf_uhdf_path/ipc:libhdf_ipc_adapter",
88    "$hdf_uhdf_path/utils:libhdf_utils",
89  ]
90
91  if (is_standard_system) {
92    external_deps = [
93      "c_utils:utils",
94      "hilog:libhilog",
95    ]
96  } else {
97    external_deps = [ "hilog:libhilog" ]
98  }
99
100  external_deps += [
101    "googletest:gmock_main",
102    "googletest:gtest_main",
103  ]
104}
105
106###########################end###########################
107group("unittest") {
108  testonly = true
109  deps = [
110    ":DevHostTest",
111    ":DevMgrTest",
112  ]
113}
114