• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022  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")
15
16module_output_path = "device_usage_statistics/deviceusagestatisticstest"
17
18config("module_private_config") {
19  visibility = [ ":*" ]
20
21  include_dirs = [
22    "//foundation/resourceschedule/device_usage_statistics/interfaces/innerkits/include",
23    "//foundation/resourceschedule/device_usage_statistics/services/common/include",
24    "//foundation/resourceschedule/device_usage_statistics/services/packageusage/include",
25    "//foundation/resourceschedule/device_usage_statistics/services/packagegroup/include",
26    "//third_party/jsoncpp/include",
27  ]
28}
29
30ohos_unittest("DeviceUsageStatsTest") {
31  module_out_path = module_output_path
32
33  sources = [ "device_usage_statistics_test.cpp" ]
34
35  configs = [ ":module_private_config" ]
36
37  deps = [
38    "//foundation/resourceschedule/device_usage_statistics:usagestatservice",
39    "//foundation/resourceschedule/device_usage_statistics:usagestatsinner",
40  ]
41
42  external_deps = [
43    "c_utils:utils",
44    "eventhandler:libeventhandler",
45    "hiviewdfx_hilog_native:libhilog",
46    "ipc:ipc_core",
47    "power_manager:powermgr_client",
48    "safwk:system_ability_fwk",
49    "samgr:samgr_proxy",
50  ]
51}
52
53ohos_unittest("DeviceUsageStatsServiceTest") {
54  module_out_path = module_output_path
55
56  sources = [ "device_usage_statistics_service_test.cpp" ]
57
58  configs = [
59    ":module_private_config",
60    "//foundation/ability/ability_runtime/interfaces/inner_api/wantagent:wantagent_innerkits_public_config",
61  ]
62
63  deps = [
64    "//foundation/resourceschedule/device_usage_statistics:usagestatservice",
65    "//foundation/resourceschedule/device_usage_statistics:usagestatsinner",
66  ]
67
68  external_deps = [
69    "ability_runtime:app_manager",
70    "access_token:libaccesstoken_sdk",
71    "c_utils:utils",
72    "common_event_service:cesfwk_innerkits",
73    "eventhandler:libeventhandler",
74    "hiviewdfx_hilog_native:libhilog",
75    "ipc:ipc_core",
76    "power_manager:powermgr_client",
77    "relational_store:native_rdb",
78    "safwk:system_ability_fwk",
79    "samgr:samgr_proxy",
80    "time_service:time_client",
81  ]
82}
83
84ohos_unittest("DeviceUsageStatsMockTest") {
85  module_out_path = module_output_path
86
87  sources = [
88    "device_usage_statistics_mock_test.cpp",
89    "mock/bundle_active_account_helper_mock.cpp",
90    "mock/bundle_active_client_mock.cpp",
91    "mock/bundle_active_core_mock.cpp",
92    "mock/bundle_active_service_mock.cpp",
93    "mock/bundle_active_usage_database_mock.cpp",
94  ]
95
96  configs = [
97    ":module_private_config",
98    "//foundation/ability/ability_runtime/interfaces/inner_api/wantagent:wantagent_innerkits_public_config",
99  ]
100
101  deps = [
102    "//foundation/resourceschedule/device_usage_statistics:usagestatservice",
103    "//foundation/resourceschedule/device_usage_statistics:usagestatsinner",
104    "//third_party/jsoncpp:jsoncpp",
105  ]
106
107  external_deps = [
108    "ability_runtime:app_manager",
109    "access_token:libaccesstoken_sdk",
110    "c_utils:utils",
111    "common_event_service:cesfwk_innerkits",
112    "eventhandler:libeventhandler",
113    "hiviewdfx_hilog_native:libhilog",
114    "ipc:ipc_core",
115    "power_manager:powermgr_client",
116    "relational_store:native_rdb",
117    "safwk:system_ability_fwk",
118    "samgr:samgr_proxy",
119    "time_service:time_client",
120  ]
121}
122
123ohos_unittest("DeviceUsagePackageUsageTest") {
124  module_out_path = module_output_path
125
126  sources = [ "package_usage_test.cpp" ]
127
128  configs = [
129    ":module_private_config",
130    "//foundation/ability/ability_runtime/interfaces/inner_api/wantagent:wantagent_innerkits_public_config",
131  ]
132
133  deps = [
134    "//foundation/resourceschedule/device_usage_statistics:usagestatservice",
135    "//foundation/resourceschedule/device_usage_statistics:usagestatsinner",
136    "//third_party/jsoncpp:jsoncpp",
137  ]
138
139  external_deps = [
140    "ability_runtime:app_manager",
141    "access_token:libaccesstoken_sdk",
142    "bundle_framework:appexecfwk_base",
143    "c_utils:utils",
144    "common_event_service:cesfwk_innerkits",
145    "eventhandler:libeventhandler",
146    "hiviewdfx_hilog_native:libhilog",
147    "ipc:ipc_core",
148    "power_manager:powermgr_client",
149    "relational_store:native_rdb",
150    "safwk:system_ability_fwk",
151    "samgr:samgr_proxy",
152    "time_service:time_client",
153  ]
154}
155
156group("unittest") {
157  testonly = true
158  deps = [
159    ":DeviceUsagePackageUsageTest",
160    ":DeviceUsageStatsMockTest",
161    ":DeviceUsageStatsServiceTest",
162    ":DeviceUsageStatsTest",
163  ]
164}
165