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_sorting_map_test.cpp", 59 "${frameworks_module_ans_path}/test/unittest/notification_sorting_test.cpp", 60 "${frameworks_module_ans_path}/test/unittest/notification_subscribe_info_test.cpp", 61 "${frameworks_module_ans_path}/test/unittest/notification_template_test.cpp", 62 "${frameworks_module_ans_path}/test/unittest/notification_test.cpp", 63 "${frameworks_module_ans_path}/test/unittest/notification_time_test.cpp", 64 "${frameworks_module_ans_path}/test/unittest/notification_unified_group_info_test.cpp", 65 "${frameworks_module_ans_path}/test/unittest/notification_user_input_test.cpp", 66 "${frameworks_module_ans_path}/test/unittest/push_promise_callback_test.cpp", 67 "${frameworks_module_ans_path}/test/unittest/reminder_helper_test.cpp", 68 "${frameworks_module_ans_path}/test/unittest/reminder_request_alarm_test.cpp", 69 "${frameworks_module_ans_path}/test/unittest/reminder_request_calendar_test.cpp", 70 "${frameworks_module_ans_path}/test/unittest/reminder_request_timer_test.cpp", 71 "${frameworks_module_ans_path}/test/unittest/reminder_store_test.cpp", 72 ] 73 74 deps = [ 75 "${frameworks_module_ans_path}:ans_innerkits", 76 "${services_path}/ans:libans", 77 "//third_party/googletest:gtest_main", 78 ] 79 80 defines = [] 81 if (distributed_notification_supported) { 82 defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ] 83 deps += [ "${services_path}/distributed:libans_distributed" ] 84 } 85 86 external_deps = [ 87 "ability_base:base", 88 "ability_base:want", 89 "ability_base:zuri", 90 "ability_runtime:wantagent_innerkits", 91 "access_token:libnativetoken", 92 "access_token:libtoken_setproc", 93 "bundle_framework:appexecfwk_base", 94 "bundle_framework:appexecfwk_core", 95 "c_utils:utils", 96 "common_event_service:cesfwk_innerkits", 97 "eventhandler:libeventhandler", 98 "hilog:libhilog", 99 "hitrace:hitrace_meter", 100 "image_framework:image_native", 101 "ipc:ipc_core", 102 "kv_store:distributeddata_inner", 103 "relational_store:native_rdb", 104 "safwk:system_ability_fwk", 105 "samgr:samgr_proxy", 106 ] 107 108 subsystem_name = "${subsystem_name}" 109 part_name = "${component_name}" 110 111 sanitize = { 112 cfi = true 113 cfi_cross_dso = true 114 debug = false 115 } 116 branch_protector_ret = "pac_ret" 117} 118 119ohos_unittest("reminder_request_test") { 120 module_out_path = module_output_path 121 122 include_dirs = [ 123 ".", 124 "include", 125 "/${services_path}/ans/include", 126 "${services_path}/ans/test/unittest/mock/include", 127 ] 128 129 sources = [ 130 "${frameworks_module_ans_path}/test/unittest/reminder_request_branch_test/mock_reminder_request.cpp", 131 "${frameworks_module_ans_path}/test/unittest/reminder_request_test.cpp", 132 ] 133 134 deps = [ 135 "${frameworks_module_ans_path}:ans_innerkits", 136 "//third_party/googletest:gtest_main", 137 ] 138 139 external_deps = [ 140 "ability_base:base", 141 "ability_base:want", 142 "ability_base:zuri", 143 "c_utils:utils", 144 "relational_store:native_rdb", 145 ] 146 147 subsystem_name = "${subsystem_name}" 148 part_name = "${component_name}" 149} 150 151ohos_unittest("reminder_request_branch_test") { 152 module_out_path = module_output_path 153 154 include_dirs = [ 155 ".", 156 "include", 157 "/${services_path}/ans/include", 158 "${services_path}/ans/test/unittest/mock/include", 159 ] 160 161 sources = [ 162 "${frameworks_module_ans_path}/test/unittest/reminder_request_branch_test/mock_reminder_request.cpp", 163 "${frameworks_module_ans_path}/test/unittest/reminder_request_branch_test/reminder_request_branch_test.cpp", 164 ] 165 166 deps = [ 167 "${frameworks_module_ans_path}:ans_innerkits", 168 "//third_party/googletest:gtest_main", 169 ] 170 171 external_deps = [ 172 "ability_base:want", 173 "ability_base:zuri", 174 "c_utils:utils", 175 "relational_store:native_rdb", 176 ] 177 178 subsystem_name = "${subsystem_name}" 179 part_name = "${component_name}" 180} 181 182group("unittest") { 183 testonly = true 184 deps = [ 185 ":ans_reminder_unit_test", 186 ":reminder_request_branch_test", 187 ":reminder_request_test", 188 ] 189} 190