1# Copyright (c) 2021-2023 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") 17import("//foundation/ability/ability_runtime/ability_runtime.gni") 18 19module_output_path = 20 "${component_name}/distributed_notification_service/moduletest" 21 22ohos_moduletest("ans_module_test") { 23 module_out_path = module_output_path 24 include_dirs = [ 25 "include", 26 "${services_path}/ans/include", 27 "${services_path}/ans/include/disturb_manager", 28 "${services_path}/ans/test/unittest", 29 "${services_path}/ans/test/unittest/mock/include", 30 "${services_path}/test/moduletest/mock/include", 31 ] 32 33 sources = [ 34 "${services_path}/ans/test/unittest/mock/mock_ipc.cpp", 35 "${test_path}/mock/mock_tokenid_kit.cpp", 36 "ans_module_test.cpp", 37 "mock/blob.cpp", 38 "mock/distributed_kv_data_manager.cpp", 39 "mock/mock_accesstoken_kit.cpp", 40 "mock/mock_bundle_manager.cpp", 41 "mock/mock_bundle_manager_helper.cpp", 42 "mock/mock_event_handler.cpp", 43 "mock/mock_single_kv_store.cpp", 44 ] 45 46 deps = [ 47 "${frameworks_module_ans_path}:ans_innerkits", 48 "${services_path}/ans:libans", 49 ] 50 51 external_deps = [ 52 "ability_base:want", 53 "ability_base:zuri", 54 "ability_runtime:ability_manager", 55 "ability_runtime:abilitykit_native", 56 "ability_runtime:app_manager", 57 "ability_runtime:wantagent_innerkits", 58 "access_token:libaccesstoken_sdk", 59 "access_token:libtokenid_sdk", 60 "bundle_framework:appexecfwk_base", 61 "bundle_framework:appexecfwk_core", 62 "c_utils:utils", 63 "common_event_service:cesfwk_innerkits", 64 "eventhandler:libeventhandler", 65 "ffrt:libffrt", 66 "hilog:libhilog", 67 "hisysevent:libhisysevent", 68 "hitrace:hitrace_meter", 69 "hitrace:libhitracechain", 70 "image_framework:image_native", 71 "ipc:ipc_core", 72 "kv_store:distributeddata_inner", 73 "os_account:os_account_innerkits", 74 "relational_store:native_rdb", 75 "safwk:system_ability_fwk", 76 "samgr:samgr_proxy", 77 "time_service:time_client", 78 ] 79 80 defines = [] 81 if (device_usage) { 82 external_deps += [ "device_usage_statistics:usagestatsinner" ] 83 defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ] 84 } 85 86 if (player_framework) { 87 external_deps += [ "player_framework:media_client" ] 88 defines += [ "PLAYER_FRAMEWORK_ENABLE" ] 89 } 90 91 if (distributed_notification_supported) { 92 defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ] 93 deps += [ "${services_path}/distributed:libans_distributed" ] 94 } 95 96 subsystem_name = "${subsystem_name}" 97 part_name = "${component_name}" 98} 99 100group("moduletest") { 101 testonly = true 102 deps = [] 103 104 deps += [ ":ans_module_test" ] 105} 106