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 = 19 "${component_name}/distributed_notification_service/unittest" 20 21ohos_unittest("reminder_test") { 22 module_out_path = module_output_path 23 24 include_dirs = [ 25 ".", 26 "include", 27 "/${services_path}/ans/include", 28 "/${services_path}/reminder/include", 29 "${services_path}/ans/test/unittest/mock/include", 30 ] 31 32 sources = [ 33 "${frameworks_module_reminder_path}/test/unittest/reminder_helper_test.cpp", 34 "${frameworks_module_reminder_path}/test/unittest/reminder_request_alarm_test.cpp", 35 "${frameworks_module_reminder_path}/test/unittest/reminder_request_calendar_test.cpp", 36 "${frameworks_module_reminder_path}/test/unittest/reminder_request_timer_test.cpp", 37 ] 38 39 deps = [ 40 "${frameworks_module_ans_path}:ans_innerkits", 41 "${frameworks_module_reminder_path}:reminder_innerkits", 42 "${services_path}/reminder:libreminder", 43 ] 44 45 defines = [] 46 if (distributed_notification_supported) { 47 defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ] 48 deps += [ "${services_path}/distributed:libans_distributed" ] 49 } 50 51 external_deps = [ 52 "ability_base:base", 53 "ability_base:want", 54 "ability_base:zuri", 55 "ability_runtime:wantagent_innerkits", 56 "access_token:libnativetoken", 57 "access_token:libtoken_setproc", 58 "bundle_framework:appexecfwk_base", 59 "bundle_framework:appexecfwk_core", 60 "c_utils:utils", 61 "common_event_service:cesfwk_innerkits", 62 "eventhandler:libeventhandler", 63 "ffrt:libffrt", 64 "hilog:libhilog", 65 "hitrace:hitrace_meter", 66 "image_framework:image_native", 67 "ipc:ipc_core", 68 "kv_store:distributeddata_inner", 69 "relational_store:native_rdb", 70 "safwk:system_ability_fwk", 71 "samgr:samgr_proxy", 72 "selinux_adapter:librestorecon", 73 ] 74 75 subsystem_name = "${subsystem_name}" 76 part_name = "${component_name}" 77 cflags = [ 78 "-Dprivate=public", 79 "-Dprotected=public", 80 ] 81 82 sanitize = { 83 cfi = true 84 cfi_cross_dso = true 85 debug = false 86 } 87 branch_protector_ret = "pac_ret" 88} 89 90ohos_unittest("reminder_request_test") { 91 module_out_path = module_output_path 92 93 include_dirs = [ 94 ".", 95 "include", 96 "/${services_path}/ans/include", 97 "/${services_path}/reminder/include", 98 "${services_path}/reminder/test/unittest/mock/include", 99 ] 100 101 sources = [ 102 "${frameworks_module_reminder_path}/test/unittest/reminder_request_branch_test/mock_reminder_request.cpp", 103 "${frameworks_module_reminder_path}/test/unittest/reminder_request_test.cpp", 104 ] 105 106 deps = [ 107 "${frameworks_module_ans_path}:ans_innerkits", 108 "${frameworks_module_reminder_path}:reminder_innerkits", 109 ] 110 111 external_deps = [ 112 "ability_base:base", 113 "ability_base:want", 114 "ability_base:zuri", 115 "c_utils:utils", 116 "hilog:libhilog", 117 "relational_store:native_rdb", 118 ] 119 cflags = [ 120 "-Dprivate=public", 121 "-Dprotected=public", 122 ] 123 124 subsystem_name = "${subsystem_name}" 125 part_name = "${component_name}" 126} 127 128ohos_unittest("reminder_request_branch_test") { 129 module_out_path = module_output_path 130 131 include_dirs = [ 132 ".", 133 "include", 134 "/${services_path}/reminder/include", 135 "${services_path}/reminder/test/unittest/mock/include", 136 ] 137 138 sources = [ 139 "${frameworks_module_reminder_path}/test/unittest/reminder_request_branch_test/mock_reminder_request.cpp", 140 "${frameworks_module_reminder_path}/test/unittest/reminder_request_branch_test/reminder_request_branch_test.cpp", 141 ] 142 143 deps = [ 144 "${frameworks_module_ans_path}:ans_innerkits", 145 "${frameworks_module_reminder_path}:reminder_innerkits", 146 ] 147 148 external_deps = [ 149 "ability_base:want", 150 "ability_base:zuri", 151 "c_utils:utils", 152 "hilog:libhilog", 153 "relational_store:native_rdb", 154 ] 155 cflags = [ 156 "-Dprivate=public", 157 "-Dprotected=public", 158 ] 159 160 subsystem_name = "${subsystem_name}" 161 part_name = "${component_name}" 162} 163 164ohos_unittest("reminder_agent_idl_test") { 165 module_out_path = module_output_path 166 167 include_dirs = [ 168 ".", 169 "include", 170 "mock", 171 "/${services_path}/reminder/include", 172 "${services_path}/reminder/test/unittest/mock/include", 173 ] 174 175 sources = [ "${frameworks_module_reminder_path}/test/unittest/reminder_agent_proxy_test.cpp" ] 176 177 deps = [ 178 "${frameworks_module_ans_path}:ans_innerkits", 179 "${frameworks_module_reminder_path}:reminder_innerkits", 180 ] 181 182 external_deps = [ 183 "ability_base:want", 184 "ability_base:zuri", 185 "c_utils:utils", 186 "googletest:gmock_main", 187 "hilog:libhilog", 188 "ipc:ipc_core", 189 "relational_store:native_rdb", 190 ] 191 cflags = [ 192 "-Dprivate=public", 193 "-Dprotected=public", 194 ] 195 196 subsystem_name = "${subsystem_name}" 197 part_name = "${component_name}" 198} 199 200group("unittest") { 201 testonly = true 202 deps = [ 203 ":reminder_agent_idl_test", 204 ":reminder_request_branch_test", 205 ":reminder_request_test", 206 ":reminder_test", 207 ] 208} 209