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 "${frameworks_module_ans_path}/test/unittest/notification_operation_info_test.cpp", 71 ] 72 73 cflags = [ 74 "-Dprivate=public", 75 "-Dprotected=public", 76 ] 77 78 deps = [ 79 "${frameworks_module_ans_path}:ans_innerkits", 80 "${services_path}/ans:libans", 81 ] 82 83 defines = [] 84 if (distributed_notification_supported) { 85 defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ] 86 deps += [ "${services_path}/distributed:libans_distributed" ] 87 } 88 89 external_deps = [ 90 "ability_base:base", 91 "ability_base:want", 92 "ability_base:zuri", 93 "ability_runtime:wantagent_innerkits", 94 "access_token:libnativetoken", 95 "access_token:libtoken_setproc", 96 "bundle_framework:appexecfwk_base", 97 "bundle_framework:appexecfwk_core", 98 "c_utils:utils", 99 "common_event_service:cesfwk_innerkits", 100 "eventhandler:libeventhandler", 101 "ffrt:libffrt", 102 "hilog:libhilog", 103 "hitrace:hitrace_meter", 104 "image_framework:image_native", 105 "ipc:ipc_core", 106 "kv_store:distributeddata_inner", 107 "relational_store:native_rdb", 108 "safwk:system_ability_fwk", 109 "samgr:samgr_proxy", 110 "selinux_adapter:librestorecon", 111 ] 112 113 subsystem_name = "${subsystem_name}" 114 part_name = "${component_name}" 115 116 sanitize = { 117 cfi = true 118 cfi_cross_dso = true 119 debug = false 120 } 121 branch_protector_ret = "pac_ret" 122} 123 124group("unittest") { 125 testonly = true 126 deps = [ ":ans_test" ] 127} 128