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("//build/test.gni") 15import("../../../../access_token.gni") 16 17ohos_unittest("libtoken_sync_service_standard_test") { 18 subsystem_name = "accesscontrol" 19 module_out_path = module_output_path_unittest_accesstoken 20 sanitize = { 21 cfi = true 22 cfi_cross_dso = true 23 debug = false 24 } 25 branch_protector_ret = "pac_ret" 26 27 sources = [ 28 "${access_token_path}/interfaces/innerkits/accesstoken/test/unittest/common/test_common.cpp", 29 "../../src/command/base_remote_command.cpp", 30 "../../src/command/delete_remote_token_command.cpp", 31 "../../src/command/sync_remote_hap_token_command.cpp", 32 "../../src/command/update_remote_hap_token_command.cpp", 33 "../../src/device/device_info_manager.cpp", 34 "../../src/device/device_info_repository.cpp", 35 "../../src/remote/remote_command_executor.cpp", 36 "../../src/remote/remote_command_factory.cpp", 37 "../../src/remote/remote_command_manager.cpp", 38 "../../src/remote/soft_bus_channel.cpp", 39 "../../src/remote/soft_bus_device_connection_listener.cpp", 40 "../../src/remote/soft_bus_manager.cpp", 41 "../../src/remote/soft_bus_socket_listener.cpp", 42 "../../src/service/token_sync_manager_service.cpp", 43 "../../src/service/token_sync_manager_stub.cpp", 44 "../mock/src/constant_mock.cpp", 45 "../mock/src/soft_bus_socket_mock.cpp", 46 "token_sync_service_test.cpp", 47 ] 48 49 include_dirs = [ 50 "../../include/service", 51 "../../include/remote", 52 "../../include/command", 53 "../../include/common", 54 "../../include/device", 55 "../../include/protocol", 56 "../mock/include", 57 "${access_token_path}/frameworks/common/include", 58 "${access_token_path}/frameworks/accesstoken/include", 59 "${access_token_path}/frameworks/tokensync/include", 60 "${access_token_path}/interfaces/innerkits/accesstoken/include", 61 "${access_token_path}/interfaces/innerkits/nativetoken/include", 62 "${access_token_path}/interfaces/innerkits/token_setproc/include", 63 "${access_token_path}/services/accesstokenmanager/main/cpp/include/permission", 64 "${access_token_path}/frameworks/json_adapter/include", 65 "${access_token_path}/services/common/json_parse/include", 66 "${access_token_path}/services/common/handler/include", 67 "${access_token_path}/interfaces/innerkits/accesstoken/test/unittest/common/", 68 "${access_token_path}/interfaces/innerkits/tokensync/include", 69 ] 70 71 deps = [ 72 "${access_token_path}/frameworks/accesstoken:accesstoken_communication_adapter_cxx", 73 "${access_token_path}/frameworks/common:accesstoken_common_cxx", 74 "${access_token_path}/frameworks/json_adapter:accesstoken_cjson_utils", 75 "${access_token_path}/interfaces/innerkits/accesstoken:libaccesstoken_sdk", 76 "${access_token_path}/interfaces/innerkits/token_setproc:libtokensetproc_shared", 77 "${access_token_path}/services/common:accesstoken_service_common", 78 ] 79 80 cflags_cc = [ "-DHILOG_ENABLE" ] 81 82 if (token_sync_enable == true) { 83 cflags_cc += [ "-DTOKEN_SYNC_ENABLE" ] 84 } 85 86 configs = [ "${access_token_path}/config:coverage_flags" ] 87 88 external_deps = [ 89 "cJSON:cjson", 90 "c_utils:utils", 91 "dsoftbus:softbus_client", 92 "hilog:libhilog", 93 "ipc:ipc_single", 94 "safwk:system_ability_fwk", 95 "samgr:samgr_proxy", 96 "zlib:libz", 97 ] 98 if (eventhandler_enable == true) { 99 cflags_cc += [ "-DEVENTHANDLER_ENABLE" ] 100 external_deps += [ "eventhandler:libeventhandler" ] 101 } 102 103 if (memory_manager_enable == true) { 104 cflags_cc += [ "-DMEMORY_MANAGER_ENABLE" ] 105 external_deps += [ "memmgr:memmgrclient" ] 106 } 107} 108