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 ] 73 74 subsystem_name = "${subsystem_name}" 75 part_name = "${component_name}" 76 cflags = [ 77 "-Dprivate=public", 78 "-Dprotected=public", 79 ] 80 81 sanitize = { 82 cfi = true 83 cfi_cross_dso = true 84 debug = false 85 } 86 branch_protector_ret = "pac_ret" 87} 88 89ohos_unittest("reminder_request_test") { 90 module_out_path = module_output_path 91 92 include_dirs = [ 93 ".", 94 "include", 95 "/${services_path}/ans/include", 96 "/${services_path}/reminder/include", 97 "${services_path}/reminder/test/unittest/mock/include", 98 ] 99 100 sources = [ 101 "${frameworks_module_reminder_path}/test/unittest/reminder_request_branch_test/mock_reminder_request.cpp", 102 "${frameworks_module_reminder_path}/test/unittest/reminder_request_test.cpp", 103 ] 104 105 deps = [ 106 "${frameworks_module_ans_path}:ans_innerkits", 107 "${frameworks_module_reminder_path}:reminder_innerkits", 108 ] 109 110 external_deps = [ 111 "ability_base:base", 112 "ability_base:want", 113 "ability_base:zuri", 114 "c_utils:utils", 115 "relational_store:native_rdb", 116 ] 117 cflags = [ 118 "-Dprivate=public", 119 "-Dprotected=public", 120 ] 121 122 subsystem_name = "${subsystem_name}" 123 part_name = "${component_name}" 124} 125 126ohos_unittest("reminder_request_branch_test") { 127 module_out_path = module_output_path 128 129 include_dirs = [ 130 ".", 131 "include", 132 "/${services_path}/reminder/include", 133 "${services_path}/reminder/test/unittest/mock/include", 134 ] 135 136 sources = [ 137 "${frameworks_module_reminder_path}/test/unittest/reminder_request_branch_test/mock_reminder_request.cpp", 138 "${frameworks_module_reminder_path}/test/unittest/reminder_request_branch_test/reminder_request_branch_test.cpp", 139 ] 140 141 deps = [ 142 "${frameworks_module_ans_path}:ans_innerkits", 143 "${frameworks_module_reminder_path}:reminder_innerkits", 144 ] 145 146 external_deps = [ 147 "ability_base:want", 148 "ability_base:zuri", 149 "c_utils:utils", 150 "relational_store:native_rdb", 151 ] 152 cflags = [ 153 "-Dprivate=public", 154 "-Dprotected=public", 155 ] 156 157 subsystem_name = "${subsystem_name}" 158 part_name = "${component_name}" 159} 160 161ohos_unittest("reminder_agent_idl_test") { 162 module_out_path = module_output_path 163 164 include_dirs = [ 165 ".", 166 "include", 167 "mock", 168 "/${services_path}/reminder/include", 169 "${services_path}/reminder/test/unittest/mock/include", 170 ] 171 172 sources = [ "${frameworks_module_reminder_path}/test/unittest/reminder_agent_proxy_test.cpp" ] 173 174 deps = [ 175 "${frameworks_module_ans_path}:ans_innerkits", 176 "${frameworks_module_reminder_path}:reminder_innerkits", 177 ] 178 179 external_deps = [ 180 "ability_base:want", 181 "ability_base:zuri", 182 "c_utils:utils", 183 "googletest:gmock_main", 184 "ipc:ipc_core", 185 "relational_store:native_rdb", 186 ] 187 cflags = [ 188 "-Dprivate=public", 189 "-Dprotected=public", 190 ] 191 192 subsystem_name = "${subsystem_name}" 193 part_name = "${component_name}" 194} 195 196group("unittest") { 197 testonly = true 198 deps = [ 199 ":reminder_agent_idl_test", 200 ":reminder_request_branch_test", 201 ":reminder_request_test", 202 ":reminder_test", 203 ] 204} 205