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