1# Copyright (c) 2021-2024 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("ans_reminder_unit_test") {
21  module_out_path = module_output_path
22
23  include_dirs = [
24    ".",
25    "include",
26    "/${services_path}/ans/include",
27    "${services_path}/ans/test/unittest/mock/include",
28    "${ffrt_path}/interfaces/kits",
29  ]
30
31  sources = [
32    "${frameworks_module_ans_path}/test/unittest/ans_dialog_host_client_test.cpp",
33    "${frameworks_module_ans_path}/test/unittest/ans_log_test.cpp",
34    "${frameworks_module_ans_path}/test/unittest/enabled_notification_callback_data_test.cpp",
35    "${frameworks_module_ans_path}/test/unittest/message_user_test.cpp",
36    "${frameworks_module_ans_path}/test/unittest/notification_action_button_test.cpp",
37    "${frameworks_module_ans_path}/test/unittest/notification_bundle_option_test.cpp",
38    "${frameworks_module_ans_path}/test/unittest/notification_button_option_test.cpp",
39    "${frameworks_module_ans_path}/test/unittest/notification_capsule_test.cpp",
40    "${frameworks_module_ans_path}/test/unittest/notification_check_info_test.cpp",
41    "${frameworks_module_ans_path}/test/unittest/notification_check_request_test.cpp",
42    "${frameworks_module_ans_path}/test/unittest/notification_content_test.cpp",
43    "${frameworks_module_ans_path}/test/unittest/notification_conversational_content_test.cpp",
44    "${frameworks_module_ans_path}/test/unittest/notification_conversational_message_test.cpp",
45    "${frameworks_module_ans_path}/test/unittest/notification_do_not_disturb_date_test.cpp",
46    "${frameworks_module_ans_path}/test/unittest/notification_do_not_disturb_profile_test.cpp",
47    "${frameworks_module_ans_path}/test/unittest/notification_flags_test.cpp",
48    "${frameworks_module_ans_path}/test/unittest/notification_helper_test.cpp",
49    "${frameworks_module_ans_path}/test/unittest/notification_live_view_content_test.cpp",
50    "${frameworks_module_ans_path}/test/unittest/notification_local_live_view_button_test.cpp",
51    "${frameworks_module_ans_path}/test/unittest/notification_local_live_view_content_test.cpp",
52    "${frameworks_module_ans_path}/test/unittest/notification_long_text_content_test.cpp",
53    "${frameworks_module_ans_path}/test/unittest/notification_media_content_test.cpp",
54    "${frameworks_module_ans_path}/test/unittest/notification_multiline_content_test.cpp",
55    "${frameworks_module_ans_path}/test/unittest/notification_picture_content_test.cpp",
56    "${frameworks_module_ans_path}/test/unittest/notification_progress_test.cpp",
57    "${frameworks_module_ans_path}/test/unittest/notification_request_test.cpp",
58    "${frameworks_module_ans_path}/test/unittest/notification_slot_test.cpp",
59    "${frameworks_module_ans_path}/test/unittest/notification_sorting_map_test.cpp",
60    "${frameworks_module_ans_path}/test/unittest/notification_sorting_test.cpp",
61    "${frameworks_module_ans_path}/test/unittest/notification_subscribe_info_test.cpp",
62    "${frameworks_module_ans_path}/test/unittest/notification_template_test.cpp",
63    "${frameworks_module_ans_path}/test/unittest/notification_test.cpp",
64    "${frameworks_module_ans_path}/test/unittest/notification_time_test.cpp",
65    "${frameworks_module_ans_path}/test/unittest/notification_unified_group_info_test.cpp",
66    "${frameworks_module_ans_path}/test/unittest/notification_user_input_test.cpp",
67    "${frameworks_module_ans_path}/test/unittest/push_promise_callback_test.cpp",
68    "${frameworks_module_ans_path}/test/unittest/reminder_helper_test.cpp",
69    "${frameworks_module_ans_path}/test/unittest/reminder_request_alarm_test.cpp",
70    "${frameworks_module_ans_path}/test/unittest/reminder_request_calendar_test.cpp",
71    "${frameworks_module_ans_path}/test/unittest/reminder_request_timer_test.cpp",
72    "${frameworks_module_ans_path}/test/unittest/reminder_store_test.cpp",
73  ]
74
75  deps = [
76    "${frameworks_module_ans_path}:ans_innerkits",
77    "${services_path}/ans:libans",
78    "//third_party/googletest:gtest_main",
79  ]
80
81  defines = []
82  if (distributed_notification_supported) {
83    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
84    deps += [ "${services_path}/distributed:libans_distributed" ]
85  }
86
87  external_deps = [
88    "ability_base:base",
89    "ability_base:want",
90    "ability_base:zuri",
91    "ability_runtime:wantagent_innerkits",
92    "access_token:libnativetoken",
93    "access_token:libtoken_setproc",
94    "bundle_framework:appexecfwk_base",
95    "bundle_framework:appexecfwk_core",
96    "c_utils:utils",
97    "common_event_service:cesfwk_innerkits",
98    "eventhandler:libeventhandler",
99    "hilog:libhilog",
100    "hitrace:hitrace_meter",
101    "image_framework:image_native",
102    "ipc:ipc_core",
103    "kv_store:distributeddata_inner",
104    "relational_store:native_rdb",
105    "safwk:system_ability_fwk",
106    "samgr:samgr_proxy",
107  ]
108
109  subsystem_name = "${subsystem_name}"
110  part_name = "${component_name}"
111
112  sanitize = {
113    cfi = true
114    cfi_cross_dso = true
115    debug = false
116  }
117  branch_protector_ret = "pac_ret"
118}
119
120ohos_unittest("reminder_request_test") {
121  module_out_path = module_output_path
122
123  include_dirs = [
124    ".",
125    "include",
126    "/${services_path}/ans/include",
127    "${services_path}/ans/test/unittest/mock/include",
128  ]
129
130  sources = [
131    "${frameworks_module_ans_path}/test/unittest/reminder_request_branch_test/mock_reminder_request.cpp",
132    "${frameworks_module_ans_path}/test/unittest/reminder_request_test.cpp",
133  ]
134
135  deps = [
136    "${frameworks_module_ans_path}:ans_innerkits",
137    "//third_party/googletest:gtest_main",
138  ]
139
140  external_deps = [
141    "ability_base:base",
142    "ability_base:want",
143    "ability_base:zuri",
144    "c_utils:utils",
145    "relational_store:native_rdb",
146  ]
147
148  subsystem_name = "${subsystem_name}"
149  part_name = "${component_name}"
150}
151
152ohos_unittest("reminder_request_branch_test") {
153  module_out_path = module_output_path
154
155  include_dirs = [
156    ".",
157    "include",
158    "/${services_path}/ans/include",
159    "${services_path}/ans/test/unittest/mock/include",
160  ]
161
162  sources = [
163    "${frameworks_module_ans_path}/test/unittest/reminder_request_branch_test/mock_reminder_request.cpp",
164    "${frameworks_module_ans_path}/test/unittest/reminder_request_branch_test/reminder_request_branch_test.cpp",
165  ]
166
167  deps = [
168    "${frameworks_module_ans_path}:ans_innerkits",
169    "//third_party/googletest:gtest_main",
170  ]
171
172  external_deps = [
173    "ability_base:want",
174    "ability_base:zuri",
175    "c_utils:utils",
176    "relational_store:native_rdb",
177  ]
178
179  subsystem_name = "${subsystem_name}"
180  part_name = "${component_name}"
181}
182
183group("unittest") {
184  testonly = true
185  deps = [
186    ":ans_reminder_unit_test",
187    ":reminder_request_branch_test",
188    ":reminder_request_test",
189  ]
190}
191