1060ff233Sopenharmony_ci# Copyright (c) 2022-2023 Huawei Device Co., Ltd. 2060ff233Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 3060ff233Sopenharmony_ci# you may not use this file except in compliance with the License. 4060ff233Sopenharmony_ci# You may obtain a copy of the License at 5060ff233Sopenharmony_ci# 6060ff233Sopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 7060ff233Sopenharmony_ci# 8060ff233Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 9060ff233Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 10060ff233Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11060ff233Sopenharmony_ci# See the License for the specific language governing permissions and 12060ff233Sopenharmony_ci# limitations under the License. 13060ff233Sopenharmony_ci 14060ff233Sopenharmony_ciimport("//build/test.gni") 15060ff233Sopenharmony_ciimport("../../../dsoftbus.gni") 16060ff233Sopenharmony_ci 17060ff233Sopenharmony_cimodule_output_path = "dsoftbus/core" 18060ff233Sopenharmony_cidsoftbus_root_path = "../../.." 19060ff233Sopenharmony_ci 20060ff233Sopenharmony_ciohos_unittest("LnnKVAdapterTest") { 21060ff233Sopenharmony_ci module_out_path = module_output_path 22060ff233Sopenharmony_ci sources = [ "unittest/lnn_kv_adapter_test.cpp" ] 23060ff233Sopenharmony_ci include_dirs = [ 24060ff233Sopenharmony_ci "$dsoftbus_root_path/core/adapter/kv_store/include", 25060ff233Sopenharmony_ci "$dsoftbus_root_path/core/adapter/bus_center/include", 26060ff233Sopenharmony_ci "$dsoftbus_root_path/core/common/include", 27060ff233Sopenharmony_ci ] 28060ff233Sopenharmony_ci deps = [ 29060ff233Sopenharmony_ci "$dsoftbus_root_path/core/common:softbus_utils", 30060ff233Sopenharmony_ci "$dsoftbus_root_path/core/frame:softbus_server", 31060ff233Sopenharmony_ci ] 32060ff233Sopenharmony_ci external_deps = [ "kv_store:distributeddata_inner" ] 33060ff233Sopenharmony_ci} 34060ff233Sopenharmony_ci 35060ff233Sopenharmony_ciohos_unittest("LnnKVAdapterWrapperTest") { 36060ff233Sopenharmony_ci module_out_path = module_output_path 37060ff233Sopenharmony_ci sources = [ "unittest/lnn_kv_adapter_wrapper_test.cpp" ] 38060ff233Sopenharmony_ci include_dirs = [ 39060ff233Sopenharmony_ci "$dsoftbus_root_path/core/adapter/kv_store/include", 40060ff233Sopenharmony_ci "$dsoftbus_root_path/core/adapter/bus_center/include", 41060ff233Sopenharmony_ci "$dsoftbus_root_path/core/common/include", 42060ff233Sopenharmony_ci "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 43060ff233Sopenharmony_ci "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 44060ff233Sopenharmony_ci "$dsoftbus_root_path/core/bus_center/interface", 45060ff233Sopenharmony_ci ] 46060ff233Sopenharmony_ci deps = [ 47060ff233Sopenharmony_ci "$dsoftbus_root_path/core/common:softbus_utils", 48060ff233Sopenharmony_ci "$dsoftbus_root_path/core/frame:softbus_server", 49060ff233Sopenharmony_ci ] 50060ff233Sopenharmony_ci external_deps = [ "kv_store:distributeddata_inner" ] 51060ff233Sopenharmony_ci} 52060ff233Sopenharmony_ci 53060ff233Sopenharmony_ciohos_unittest("LnnKSettingDataEventMonitorTest") { 54060ff233Sopenharmony_ci module_out_path = module_output_path 55060ff233Sopenharmony_ci sources = [ 56060ff233Sopenharmony_ci "$dsoftbus_root_path/core/adapter/bus_center/src/lnn_settingdata_event_monitor.cpp", 57060ff233Sopenharmony_ci "unittest/lnn_settingdata_event_monitor_deps_mock.cpp", 58060ff233Sopenharmony_ci "unittest/lnn_settingdata_event_monitor_test.cpp", 59060ff233Sopenharmony_ci ] 60060ff233Sopenharmony_ci include_dirs = [ 61060ff233Sopenharmony_ci "$dsoftbus_root_path/core/adapter/kv_store/include", 62060ff233Sopenharmony_ci "$dsoftbus_root_path/core/adapter/bus_center/include", 63060ff233Sopenharmony_ci "$dsoftbus_root_path/core/adapter/bus_center/src", 64060ff233Sopenharmony_ci "$dsoftbus_root_path/core/common/include", 65060ff233Sopenharmony_ci "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 66060ff233Sopenharmony_ci "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 67060ff233Sopenharmony_ci "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 68060ff233Sopenharmony_ci "$dsoftbus_root_path/core/bus_center/interface", 69060ff233Sopenharmony_ci "$dsoftbus_root_path/core/bus_center/utils/include", 70060ff233Sopenharmony_ci "$dsoftbus_root_path/core/bus_center/service/include/", 71060ff233Sopenharmony_ci "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", 72060ff233Sopenharmony_ci "$dsoftbus_root_path/tests/core/adapter/unittest/", 73060ff233Sopenharmony_ci "$dsoftbus_root_path/interfaces/kits/bus_center", 74060ff233Sopenharmony_ci "$dsoftbus_root_path/interfaces/kits/common", 75060ff233Sopenharmony_ci ] 76060ff233Sopenharmony_ci deps = [ "$dsoftbus_root_path/core/common:softbus_utils" ] 77060ff233Sopenharmony_ci external_deps = [ 78060ff233Sopenharmony_ci "ability_base:want", 79060ff233Sopenharmony_ci "ability_base:zuri", 80060ff233Sopenharmony_ci "ability_runtime:dataobs_manager", 81060ff233Sopenharmony_ci "data_share:datashare_consumer", 82060ff233Sopenharmony_ci "googletest:gmock_main", 83060ff233Sopenharmony_ci "googletest:gtest_main", 84060ff233Sopenharmony_ci "hilog:libhilog", 85060ff233Sopenharmony_ci "kv_store:distributeddata_inner", 86060ff233Sopenharmony_ci "samgr:samgr_proxy", 87060ff233Sopenharmony_ci ] 88060ff233Sopenharmony_ci} 89060ff233Sopenharmony_ci 90060ff233Sopenharmony_ciohos_unittest("AdapterDsoftbusRsaCryptoTest") { 91060ff233Sopenharmony_ci module_out_path = module_output_path 92060ff233Sopenharmony_ci sources = [ "unittest/dsoftbus_rsa_crypto_test.cpp" ] 93060ff233Sopenharmony_ci 94060ff233Sopenharmony_ci include_dirs = [ 95060ff233Sopenharmony_ci "$dsoftbus_root_path/adapter/common/include", 96060ff233Sopenharmony_ci "$dsoftbus_root_path/core/adapter/huks/include", 97060ff233Sopenharmony_ci "$dsoftbus_root_path/core/adapter/transmission/include", 98060ff233Sopenharmony_ci "$dsoftbus_root_path/core/common/include", 99060ff233Sopenharmony_ci "$dsoftbus_root_path/core/common/dfx/interface/include", 100060ff233Sopenharmony_ci "$dsoftbus_root_path/interfaces/kits/common", 101060ff233Sopenharmony_ci ] 102060ff233Sopenharmony_ci 103060ff233Sopenharmony_ci deps = [ 104060ff233Sopenharmony_ci "$dsoftbus_root_path/adapter:softbus_adapter", 105060ff233Sopenharmony_ci "$dsoftbus_root_path/core/common:softbus_utils", 106060ff233Sopenharmony_ci "$dsoftbus_root_path/core/frame:softbus_server", 107060ff233Sopenharmony_ci ] 108060ff233Sopenharmony_ci 109060ff233Sopenharmony_ci if (is_standard_system) { 110060ff233Sopenharmony_ci external_deps = [ 111060ff233Sopenharmony_ci "bounds_checking_function:libsec_static", 112060ff233Sopenharmony_ci "googletest:gtest_main", 113060ff233Sopenharmony_ci "hilog:libhilog", 114060ff233Sopenharmony_ci "huks:libhukssdk", 115060ff233Sopenharmony_ci "openssl:libcrypto_shared", 116060ff233Sopenharmony_ci ] 117060ff233Sopenharmony_ci } else { 118060ff233Sopenharmony_ci external_deps = [ 119060ff233Sopenharmony_ci "c_utils:utils", 120060ff233Sopenharmony_ci "hilog:libhilog", 121060ff233Sopenharmony_ci ] 122060ff233Sopenharmony_ci } 123060ff233Sopenharmony_ci} 124060ff233Sopenharmony_ci 125060ff233Sopenharmony_ciohos_unittest("LNNOhosAccountTest") { 126060ff233Sopenharmony_ci module_out_path = module_output_path 127060ff233Sopenharmony_ci sources = [ 128060ff233Sopenharmony_ci "unittest/lnn_ohos_account_mock.cpp", 129060ff233Sopenharmony_ci "unittest/lnn_ohos_account_test.cpp", 130060ff233Sopenharmony_ci ] 131060ff233Sopenharmony_ci include_dirs = [ 132060ff233Sopenharmony_ci "$dsoftbus_root_path/core/adapter/kv_store/include", 133060ff233Sopenharmony_ci "$dsoftbus_root_path/core/adapter/bus_center/include", 134060ff233Sopenharmony_ci "$dsoftbus_root_path/core/common/include", 135060ff233Sopenharmony_ci "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 136060ff233Sopenharmony_ci "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 137060ff233Sopenharmony_ci "$dsoftbus_root_path/core/bus_center/interface", 138060ff233Sopenharmony_ci "$dsoftbus_root_path/interfaces/kits/common", 139060ff233Sopenharmony_ci ] 140060ff233Sopenharmony_ci deps = [ 141060ff233Sopenharmony_ci "$dsoftbus_root_path/core/common:softbus_utils", 142060ff233Sopenharmony_ci "$dsoftbus_root_path/core/frame:softbus_server", 143060ff233Sopenharmony_ci ] 144060ff233Sopenharmony_ci external_deps = [ 145060ff233Sopenharmony_ci "bounds_checking_function:libsec_static", 146060ff233Sopenharmony_ci "c_utils:utils", 147060ff233Sopenharmony_ci "googletest:gmock_main", 148060ff233Sopenharmony_ci "googletest:gtest_main", 149060ff233Sopenharmony_ci "hilog:libhilog", 150060ff233Sopenharmony_ci ] 151060ff233Sopenharmony_ci} 152060ff233Sopenharmony_ci 153060ff233Sopenharmony_ciohos_unittest("LNNKvStoreLaunchListenerTest") { 154060ff233Sopenharmony_ci module_out_path = module_output_path 155060ff233Sopenharmony_ci sources = [ 156060ff233Sopenharmony_ci "$dsoftbus_root_path/core/adapter/subscribe_kv_store_sa/src/lnn_kv_store_launch_listener.cpp", 157060ff233Sopenharmony_ci "unittest/lnn_kv_store_launch_listener_mock.cpp", 158060ff233Sopenharmony_ci "unittest/lnn_kv_store_launch_listener_test.cpp", 159060ff233Sopenharmony_ci ] 160060ff233Sopenharmony_ci include_dirs = [ 161060ff233Sopenharmony_ci "$dsoftbus_root_path/core/adapter/kv_store/include", 162060ff233Sopenharmony_ci "$dsoftbus_root_path/core/adapter/subscribe_kv_store_sa/include", 163060ff233Sopenharmony_ci "$dsoftbus_root_path/core/adapter/bus_center/include", 164060ff233Sopenharmony_ci "$dsoftbus_root_path/core/common/include", 165060ff233Sopenharmony_ci "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 166060ff233Sopenharmony_ci "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 167060ff233Sopenharmony_ci "$dsoftbus_root_path/core/bus_center/interface", 168060ff233Sopenharmony_ci "$dsoftbus_root_path/interfaces/kits/common", 169060ff233Sopenharmony_ci ] 170060ff233Sopenharmony_ci deps = [ "$dsoftbus_root_path/core/common:softbus_utils" ] 171060ff233Sopenharmony_ci external_deps = [ 172060ff233Sopenharmony_ci "bounds_checking_function:libsec_static", 173060ff233Sopenharmony_ci "c_utils:utils", 174060ff233Sopenharmony_ci "googletest:gmock_main", 175060ff233Sopenharmony_ci "googletest:gtest_main", 176060ff233Sopenharmony_ci "hilog:libhilog", 177060ff233Sopenharmony_ci "ipc:ipc_core", 178060ff233Sopenharmony_ci "safwk:system_ability_fwk", 179060ff233Sopenharmony_ci "samgr:samgr_proxy", 180060ff233Sopenharmony_ci ] 181060ff233Sopenharmony_ci} 182060ff233Sopenharmony_ci 183060ff233Sopenharmony_ciohos_unittest("LnnOhosAccountAdapterTest") { 184060ff233Sopenharmony_ci module_out_path = module_output_path 185060ff233Sopenharmony_ci sources = [ 186060ff233Sopenharmony_ci "$dsoftbus_root_path/core/adapter/bus_center/src/lnn_ohos_account_adapter.cpp", 187060ff233Sopenharmony_ci "unittest/lnn_ohos_account_adapter_mock.cpp", 188060ff233Sopenharmony_ci "unittest/lnn_ohos_account_adapter_test.cpp", 189060ff233Sopenharmony_ci ] 190060ff233Sopenharmony_ci 191060ff233Sopenharmony_ci include_dirs = [ 192060ff233Sopenharmony_ci "unittest", 193060ff233Sopenharmony_ci "$dsoftbus_root_path/core/adapter/bus_center/include", 194060ff233Sopenharmony_ci "$dsoftbus_root_path/core/authentication/include", 195060ff233Sopenharmony_ci "$dsoftbus_root_path/interfaces/kits/common", 196060ff233Sopenharmony_ci ] 197060ff233Sopenharmony_ci 198060ff233Sopenharmony_ci deps = [ 199060ff233Sopenharmony_ci "$dsoftbus_root_path/adapter:softbus_adapter", 200060ff233Sopenharmony_ci "$dsoftbus_root_path/core/common:softbus_utils", 201060ff233Sopenharmony_ci "$dsoftbus_root_path/core/frame:softbus_server", 202060ff233Sopenharmony_ci ] 203060ff233Sopenharmony_ci 204060ff233Sopenharmony_ci if (is_standard_system) { 205060ff233Sopenharmony_ci external_deps = [ 206060ff233Sopenharmony_ci "ability_base:base", 207060ff233Sopenharmony_ci "ability_base:want", 208060ff233Sopenharmony_ci "ability_base:zuri", 209060ff233Sopenharmony_ci "bounds_checking_function:libsec_static", 210060ff233Sopenharmony_ci "c_utils:utils", 211060ff233Sopenharmony_ci "device_auth:deviceauth_sdk", 212060ff233Sopenharmony_ci "googletest:gmock_main", 213060ff233Sopenharmony_ci "googletest:gtest_main", 214060ff233Sopenharmony_ci "hilog:libhilog", 215060ff233Sopenharmony_ci "ipc:ipc_single", 216060ff233Sopenharmony_ci "os_account:os_account_innerkits", 217060ff233Sopenharmony_ci ] 218060ff233Sopenharmony_ci } else { 219060ff233Sopenharmony_ci external_deps = [ 220060ff233Sopenharmony_ci "c_utils:utils", 221060ff233Sopenharmony_ci "hilog:libhilog", 222060ff233Sopenharmony_ci ] 223060ff233Sopenharmony_ci } 224060ff233Sopenharmony_ci} 225060ff233Sopenharmony_ci 226060ff233Sopenharmony_cigroup("unittest") { 227060ff233Sopenharmony_ci testonly = true 228060ff233Sopenharmony_ci 229060ff233Sopenharmony_ci deps = [ 230060ff233Sopenharmony_ci ":AdapterDsoftbusRsaCryptoTest", 231060ff233Sopenharmony_ci ":LNNKvStoreLaunchListenerTest", 232060ff233Sopenharmony_ci ":LNNOhosAccountTest", 233060ff233Sopenharmony_ci ":LnnKSettingDataEventMonitorTest", 234060ff233Sopenharmony_ci ":LnnOhosAccountAdapterTest", 235060ff233Sopenharmony_ci ] 236060ff233Sopenharmony_ci if (dsoftbus_feature_lnn_cloud_sync) { 237060ff233Sopenharmony_ci deps += [ 238060ff233Sopenharmony_ci ":LnnKVAdapterTest", 239060ff233Sopenharmony_ci ":LnnKVAdapterWrapperTest", 240060ff233Sopenharmony_ci ] 241060ff233Sopenharmony_ci } 242060ff233Sopenharmony_ci} 243060ff233Sopenharmony_ci 244060ff233Sopenharmony_cigroup("fuzztest") { 245060ff233Sopenharmony_ci testonly = true 246060ff233Sopenharmony_ci deps = [ "fuzztest:fuzztest" ] 247060ff233Sopenharmony_ci} 248