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("ans_test") { 22 module_out_path = module_output_path 23 24 include_dirs = [ 25 ".", 26 "include", 27 "/${services_path}/ans/include", 28 "${services_path}/ans/test/unittest/mock/include", 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_disable_test.cpp", 46 "${frameworks_module_ans_path}/test/unittest/notification_do_not_disturb_date_test.cpp", 47 "${frameworks_module_ans_path}/test/unittest/notification_do_not_disturb_profile_test.cpp", 48 "${frameworks_module_ans_path}/test/unittest/notification_flags_test.cpp", 49 "${frameworks_module_ans_path}/test/unittest/notification_helper_test.cpp", 50 "${frameworks_module_ans_path}/test/unittest/notification_icon_button_test.cpp", 51 "${frameworks_module_ans_path}/test/unittest/notification_live_view_content_test.cpp", 52 "${frameworks_module_ans_path}/test/unittest/notification_local_live_view_button_test.cpp", 53 "${frameworks_module_ans_path}/test/unittest/notification_local_live_view_content_test.cpp", 54 "${frameworks_module_ans_path}/test/unittest/notification_long_text_content_test.cpp", 55 "${frameworks_module_ans_path}/test/unittest/notification_media_content_test.cpp", 56 "${frameworks_module_ans_path}/test/unittest/notification_multiline_content_test.cpp", 57 "${frameworks_module_ans_path}/test/unittest/notification_picture_content_test.cpp", 58 "${frameworks_module_ans_path}/test/unittest/notification_progress_test.cpp", 59 "${frameworks_module_ans_path}/test/unittest/notification_request_test.cpp", 60 "${frameworks_module_ans_path}/test/unittest/notification_slot_test.cpp", 61 "${frameworks_module_ans_path}/test/unittest/notification_sorting_map_test.cpp", 62 "${frameworks_module_ans_path}/test/unittest/notification_sorting_test.cpp", 63 "${frameworks_module_ans_path}/test/unittest/notification_subscribe_info_test.cpp", 64 "${frameworks_module_ans_path}/test/unittest/notification_template_test.cpp", 65 "${frameworks_module_ans_path}/test/unittest/notification_test.cpp", 66 "${frameworks_module_ans_path}/test/unittest/notification_time_test.cpp", 67 "${frameworks_module_ans_path}/test/unittest/notification_unified_group_info_test.cpp", 68 "${frameworks_module_ans_path}/test/unittest/notification_user_input_test.cpp", 69 "${frameworks_module_ans_path}/test/unittest/push_promise_callback_test.cpp", 70 ] 71 72 cflags = [ 73 "-Dprivate=public", 74 "-Dprotected=public", 75 ] 76 77 deps = [ 78 "${frameworks_module_ans_path}:ans_innerkits", 79 "${services_path}/ans:libans", 80 ] 81 82 defines = [] 83 if (distributed_notification_supported) { 84 defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ] 85 deps += [ "${services_path}/distributed:libans_distributed" ] 86 } 87 88 external_deps = [ 89 "ability_base:base", 90 "ability_base:want", 91 "ability_base:zuri", 92 "ability_runtime:wantagent_innerkits", 93 "access_token:libnativetoken", 94 "access_token:libtoken_setproc", 95 "bundle_framework:appexecfwk_base", 96 "bundle_framework:appexecfwk_core", 97 "c_utils:utils", 98 "common_event_service:cesfwk_innerkits", 99 "eventhandler:libeventhandler", 100 "ffrt:libffrt", 101 "hilog:libhilog", 102 "hitrace:hitrace_meter", 103 "image_framework:image_native", 104 "ipc:ipc_core", 105 "kv_store:distributeddata_inner", 106 "relational_store:native_rdb", 107 "safwk:system_ability_fwk", 108 "samgr:samgr_proxy", 109 ] 110 111 subsystem_name = "${subsystem_name}" 112 part_name = "${component_name}" 113 114 sanitize = { 115 cfi = true 116 cfi_cross_dso = true 117 debug = false 118 } 119 branch_protector_ret = "pac_ret" 120} 121 122group("unittest") { 123 testonly = true 124 deps = [ ":ans_test" ] 125} 126