• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-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("../../../device_status.gni")
16
17module_output_path = "${device_status_part_name}/devicestatussrv"
18
19config("devicestatus_private_config") {
20  visibility = [ ":*" ]
21
22  include_dirs = [
23    "include",
24    "../../../services/native/include",
25    "../../../libs/include",
26    "../../../libs/include/algorithm",
27    "../../../libs/include/datahub",
28    "../../../libs/interface",
29    "${device_status_interfaces_path}/innerkits/include",
30    "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/include/",
31    "${ability_runtime_path}/interfaces/kits/native/ability/native/",
32    "//base/sensors/sensor/interfaces/native/include/",
33  ]
34}
35
36ohos_unittest("device_status_algorithm_test") {
37  module_out_path = module_output_path
38
39  sources = [ "src/device_status_algorithm_test.cpp" ]
40
41  configs = [
42    "${device_status_utils_path}:devicestatus_utils_config",
43    ":devicestatus_private_config",
44  ]
45
46  deps = [
47    "${device_status_interfaces_path}/innerkits:devicestatus_client",
48    "${device_status_root_path}/services:devicestatus_static_service",
49    "../../../libs:devicestatus_algo",
50    "//third_party/cJSON:cjson_static",
51    "//third_party/googletest:gtest_main",
52    "//third_party/jsoncpp",
53  ]
54
55  external_deps = [
56    "ability_base:base",
57    "access_token:libaccesstoken_sdk",
58    "c_utils:utils",
59    "hilog:libhilog",
60    "image_framework:image_native",
61    "input:libmmi-client",
62    "ipc:ipc_single",
63    "safwk:system_ability_fwk",
64    "samgr:samgr_proxy",
65    "sensor:sensor_interface_native",
66  ]
67}
68
69ohos_unittest("device_status_datahub_test") {
70  module_out_path = module_output_path
71
72  sources = [ "src/device_status_datahub_test.cpp" ]
73
74  configs = [
75    "${device_status_utils_path}:devicestatus_utils_config",
76    ":devicestatus_private_config",
77  ]
78
79  deps = [
80    "${device_status_interfaces_path}/innerkits:devicestatus_client",
81    "${device_status_root_path}/services:devicestatus_static_service",
82    "../../../libs:devicestatus_algo",
83    "../../../libs:devicestatus_mock",
84    "//third_party/cJSON:cjson_static",
85    "//third_party/googletest:gtest_main",
86    "//third_party/jsoncpp",
87  ]
88
89  external_deps = [
90    "ability_base:base",
91    "access_token:libaccesstoken_sdk",
92    "c_utils:utils",
93    "hilog:libhilog",
94    "image_framework:image_native",
95    "input:libmmi-client",
96    "ipc:ipc_single",
97    "safwk:system_ability_fwk",
98    "samgr:samgr_proxy",
99    "sensor:sensor_interface_native",
100  ]
101}
102
103ohos_unittest("device_status_mock_test") {
104  module_out_path = module_output_path
105
106  sources = [ "src/device_status_mock_test.cpp" ]
107
108  configs = [
109    "${device_status_utils_path}:devicestatus_utils_config",
110    ":devicestatus_private_config",
111  ]
112
113  deps = [
114    "${device_status_interfaces_path}/innerkits:devicestatus_client",
115    "${device_status_root_path}/services:devicestatus_static_service",
116    "../../../libs:devicestatus_algo",
117    "../../../libs:devicestatus_mock",
118    "//third_party/cJSON:cjson_static",
119    "//third_party/googletest:gtest_main",
120    "//third_party/jsoncpp",
121  ]
122
123  external_deps = [
124    "ability_base:base",
125    "access_token:libaccesstoken_sdk",
126    "c_utils:utils",
127    "hilog:libhilog",
128    "image_framework:image_native",
129    "input:libmmi-client",
130    "ipc:ipc_single",
131    "relational_store:native_rdb",
132    "safwk:system_ability_fwk",
133    "samgr:samgr_proxy",
134    "sensor:sensor_interface_native",
135  ]
136}
137
138group("unittest") {
139  testonly = true
140  deps = []
141
142  deps += [
143    ":device_status_algorithm_test",
144    ":device_status_datahub_test",
145    ":device_status_mock_test",
146  ]
147}
148