# Copyright (c) 2021-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//base/notification/distributed_notification_service/notification.gni") import("//build/ohos.gni") import("//build/test.gni") module_output_path = "${component_name}/unittest" ohos_unittest("ans_reminder_unit_test") { module_out_path = module_output_path include_dirs = [ ".", "include", "/${services_path}/ans/include", "${services_path}/ans/test/unittest/mock/include", "${ffrt_path}/interfaces/kits", ] sources = [ "${frameworks_module_ans_path}/test/unittest/ans_dialog_host_client_test.cpp", "${frameworks_module_ans_path}/test/unittest/ans_log_test.cpp", "${frameworks_module_ans_path}/test/unittest/enabled_notification_callback_data_test.cpp", "${frameworks_module_ans_path}/test/unittest/message_user_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_action_button_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_bundle_option_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_button_option_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_capsule_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_check_info_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_check_request_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_content_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_conversational_content_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_conversational_message_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_do_not_disturb_date_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_do_not_disturb_profile_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_flags_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_helper_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_live_view_content_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_local_live_view_button_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_local_live_view_content_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_long_text_content_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_media_content_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_multiline_content_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_picture_content_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_progress_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_request_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_slot_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_sorting_map_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_sorting_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_subscribe_info_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_template_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_time_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_unified_group_info_test.cpp", "${frameworks_module_ans_path}/test/unittest/notification_user_input_test.cpp", "${frameworks_module_ans_path}/test/unittest/push_promise_callback_test.cpp", "${frameworks_module_ans_path}/test/unittest/reminder_helper_test.cpp", "${frameworks_module_ans_path}/test/unittest/reminder_request_alarm_test.cpp", "${frameworks_module_ans_path}/test/unittest/reminder_request_calendar_test.cpp", "${frameworks_module_ans_path}/test/unittest/reminder_request_timer_test.cpp", "${frameworks_module_ans_path}/test/unittest/reminder_store_test.cpp", ] deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", "//third_party/googletest:gtest_main", ] defines = [] if (distributed_notification_supported) { defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ] deps += [ "${services_path}/distributed:libans_distributed" ] } external_deps = [ "ability_base:base", "ability_base:want", "ability_base:zuri", "ability_runtime:wantagent_innerkits", "access_token:libnativetoken", "access_token:libtoken_setproc", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "hilog:libhilog", "hitrace:hitrace_meter", "image_framework:image_native", "ipc:ipc_core", "kv_store:distributeddata_inner", "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] subsystem_name = "${subsystem_name}" part_name = "${component_name}" sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" } ohos_unittest("reminder_request_test") { module_out_path = module_output_path include_dirs = [ ".", "include", "/${services_path}/ans/include", "${services_path}/ans/test/unittest/mock/include", ] sources = [ "${frameworks_module_ans_path}/test/unittest/reminder_request_branch_test/mock_reminder_request.cpp", "${frameworks_module_ans_path}/test/unittest/reminder_request_test.cpp", ] deps = [ "${frameworks_module_ans_path}:ans_innerkits", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:base", "ability_base:want", "ability_base:zuri", "c_utils:utils", "relational_store:native_rdb", ] subsystem_name = "${subsystem_name}" part_name = "${component_name}" } ohos_unittest("reminder_request_branch_test") { module_out_path = module_output_path include_dirs = [ ".", "include", "/${services_path}/ans/include", "${services_path}/ans/test/unittest/mock/include", ] sources = [ "${frameworks_module_ans_path}/test/unittest/reminder_request_branch_test/mock_reminder_request.cpp", "${frameworks_module_ans_path}/test/unittest/reminder_request_branch_test/reminder_request_branch_test.cpp", ] deps = [ "${frameworks_module_ans_path}:ans_innerkits", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:want", "ability_base:zuri", "c_utils:utils", "relational_store:native_rdb", ] subsystem_name = "${subsystem_name}" part_name = "${component_name}" } group("unittest") { testonly = true deps = [ ":ans_reminder_unit_test", ":reminder_request_branch_test", ":reminder_request_test", ] }