• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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("//base/notification/distributed_notification_service/notification.gni")
15import("//build/ohos.gni")
16import("//build/test.gni")
17
18module_output_path = "${component_name}/unittest"
19
20ohos_unittest("reminder_unit_test") {
21  module_out_path = module_output_path
22  include_dirs = [
23    ".",
24    "include",
25    "//commonlibrary/c_utils/base/include",
26    "//utils/system/safwk/native/include",
27    "/${services_path}/ans/include",
28    "${services_path}/ans/test/unittest/mock/include",
29  ]
30
31  defines = []
32
33  sources = [
34    "mock/blob.cpp",
35    "mock/distributed_kv_data_manager.cpp",
36    "mock/mock_access_token_helper.cpp",
37    "mock/mock_bundle_manager_helper.cpp",
38    "mock/mock_event_handler.cpp",
39    "mock/mock_ipc.cpp",
40    "mock/mock_single_kv_store.cpp",
41    "reminder_data_manager_test.cpp",
42  ]
43
44  configs = [ "//commonlibrary/c_utils/base:utils_config" ]
45
46  deps = [
47    "${core_path}:ans_core",
48    "${frameworks_module_ans_path}:ans_innerkits",
49    "${services_path}/ans:libans",
50    "//foundation/arkui/ace_engine/interfaces/inner_api/ui_service_manager:ui_service_mgr",
51    "//third_party/googletest:gtest_main",
52  ]
53
54  if (distributed_notification_supported) {
55    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
56    deps += [ "${services_path}/distributed:libans_distributed" ]
57    include_dirs += [ "${services_path}/distributed/include" ]
58  }
59
60  external_deps = [
61    "ability_base:want",
62    "ability_base:zuri",
63    "ability_runtime:abilitykit_native",
64    "ability_runtime:app_manager",
65    "ability_runtime:wantagent_innerkits",
66    "access_token:libaccesstoken_sdk",
67    "bundle_framework:appexecfwk_base",
68    "bundle_framework:appexecfwk_core",
69    "c_utils:utils",
70    "common_event_service:cesfwk_innerkits",
71    "eventhandler:libeventhandler",
72    "hitrace_native:hitrace_meter",
73    "hitrace_native:libhitracechain",
74    "hiviewdfx_hilog_native:libhilog",
75    "ipc:ipc_core",
76    "kv_store:distributeddata_inner",
77    "multimedia_image_framework:image_native",
78    "multimedia_player_framework:media_client",
79    "os_account:os_account_innerkits",
80    "relational_store:native_rdb",
81    "safwk:system_ability_fwk",
82    "samgr:samgr_proxy",
83    "time_service:time_client",
84  ]
85
86  if (device_usage) {
87    external_deps += [ "device_usage_statistics:usagestatsinner" ]
88    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
89  }
90
91  cflags = []
92  if (hisysevent_usage) {
93    external_deps += [ "hisysevent_native:libhisysevent" ]
94    cflags += [ "-DHAS_HISYSEVENT_PART" ]
95  }
96
97  subsystem_name = "${subsystem_name}"
98  part_name = "${component_name}"
99}
100
101ohos_unittest("ans_unit_test") {
102  module_out_path = module_output_path
103  include_dirs = [
104    ".",
105    "include",
106    "//commonlibrary/c_utils/base/include",
107    "//utils/system/safwk/native/include",
108    "/${services_path}/ans/include",
109    "${services_path}/ans/test/unittest/mock/include",
110  ]
111
112  defines = []
113
114  sources = [
115    "advanced_notification_service_ability_test.cpp",
116    "advanced_notification_service_test.cpp",
117    "bundle_manager_helper_test.cpp",
118    "mock/blob.cpp",
119    "mock/distributed_kv_data_manager.cpp",
120    "mock/mock_access_token_helper.cpp",
121    "mock/mock_accesstoken_kit.cpp",
122    "mock/mock_bundle_manager_helper.cpp",
123    "mock/mock_event_handler.cpp",
124    "mock/mock_ipc.cpp",
125    "mock/mock_single_kv_store.cpp",
126    "notification_hisysevent_test.cpp",
127    "notification_preferences_database_test.cpp",
128    "notification_preferences_test.cpp",
129    "notification_slot_filter_test.cpp",
130    "notification_subscriber_manager_test.cpp",
131    "permission_filter_test.cpp",
132    "system_event_observer_test.cpp",
133  ]
134
135  configs = [ "//commonlibrary/c_utils/base:utils_config" ]
136
137  deps = [
138    "${core_path}:ans_core",
139    "${frameworks_module_ans_path}:ans_innerkits",
140    "${services_path}/ans:libans",
141    "//foundation/arkui/ace_engine/interfaces/inner_api/ui_service_manager:ui_service_mgr",
142    "//third_party/googletest:gtest_main",
143  ]
144
145  if (distributed_notification_supported) {
146    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
147    deps += [ "${services_path}/distributed:libans_distributed" ]
148    include_dirs += [ "${services_path}/distributed/include" ]
149  }
150
151  external_deps = [
152    "ability_base:want",
153    "ability_base:zuri",
154    "ability_runtime:abilitykit_native",
155    "ability_runtime:app_manager",
156    "ability_runtime:wantagent_innerkits",
157    "access_token:libaccesstoken_sdk",
158    "bundle_framework:appexecfwk_base",
159    "bundle_framework:appexecfwk_core",
160    "c_utils:utils",
161    "common_event_service:cesfwk_innerkits",
162    "eventhandler:libeventhandler",
163    "hitrace_native:hitrace_meter",
164    "hitrace_native:libhitracechain",
165    "hiviewdfx_hilog_native:libhilog",
166    "ipc:ipc_core",
167    "kv_store:distributeddata_inner",
168    "multimedia_image_framework:image_native",
169    "multimedia_player_framework:media_client",
170    "os_account:os_account_innerkits",
171    "relational_store:native_rdb",
172    "safwk:system_ability_fwk",
173    "samgr:samgr_proxy",
174    "time_service:time_client",
175  ]
176
177  if (device_usage) {
178    external_deps += [ "device_usage_statistics:usagestatsinner" ]
179    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
180  }
181
182  cflags = []
183  if (hisysevent_usage) {
184    external_deps += [ "hisysevent_native:libhisysevent" ]
185    cflags += [ "-DHAS_HISYSEVENT_PART" ]
186  }
187
188  subsystem_name = "${subsystem_name}"
189  part_name = "${component_name}"
190}
191
192group("unittest") {
193  testonly = true
194  deps = []
195
196  deps += [ ":reminder_unit_test" ]
197
198  deps += [ ":ans_unit_test" ]
199
200  deps += [ "access_token_helper_test:unittest" ]
201}
202