1# Copyright (c) 2022 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/lite/config/component/lite_component.gni") 15import("//build/ohos.gni") 16import("//build/test.gni") 17import("../../../adapter/common/net/bluetooth/net_bluetooth.gni") 18import("../../../dsoftbus.gni") 19 20dsoftbus_root_path = "../../.." 21 22if (!defined(ohos_lite)) { 23 module_output_path = "dsoftbus/soft_bus/adapter" 24 bt_test_sources = [ "bluetooth_mock.cpp" ] 25 bt_test_sources += adapter_ble_src 26 27 bt_test_inc = [ "../../../adapter/common/net/bluetooth/include" ] 28 bt_test_inc += adapter_ble_inc 29 30 bt_test_deps = [ 31 "$dsoftbus_dfx_path:softbus_dfx", 32 "$dsoftbus_root_path/core/common:softbus_utils", 33 "$dsoftbus_root_path/adapter:softbus_adapter", 34 ] 35 36 bt_test_external_deps = [ 37 "c_utils:utils", 38 "googletest:gmock_main", 39 "googletest:gtest_main", 40 "hilog:libhilog", 41 ] 42 43 if (dsoftbus_feature_deps_sle) { 44 bt_test_external_deps += [ "nearlink_service:nearlink_framework" ] 45 } 46 47 if (support_bluetooth && 48 (dsoftbus_feature_conn_ble || dsoftbus_feature_conn_br)) { 49 bt_test_external_deps += [ "bluetooth:btframework" ] 50 } 51 52 ohos_unittest("AdapterBleGattServerTest") { 53 module_out_path = module_output_path 54 sources = bt_test_sources 55 sources += [ "softbus_adapter_ble_gatt_server_test.cpp" ] 56 57 include_dirs = bt_test_inc 58 deps = bt_test_deps 59 external_deps = bt_test_external_deps 60 } 61 62 ohos_unittest("AdapterBleGattClientTest") { 63 module_out_path = module_output_path 64 sources = bt_test_sources 65 sources += [ "softbus_adapter_ble_gatt_client_test.cpp" ] 66 67 include_dirs = bt_test_inc 68 deps = bt_test_deps 69 external_deps = bt_test_external_deps 70 } 71 72 ohos_unittest("AdapterBtCommonTest") { 73 module_out_path = module_output_path 74 sources = bt_test_sources 75 sources += [ "softbus_adapter_bt_common_test.cpp" ] 76 77 include_dirs = bt_test_inc 78 deps = bt_test_deps 79 external_deps = bt_test_external_deps 80 } 81 82 group("unittest") { 83 testonly = true 84 deps = [] 85 if (support_bluetooth && 86 (dsoftbus_feature_conn_ble || dsoftbus_feature_conn_br)) { 87 deps += [ 88 ":AdapterBleGattClientTest", 89 ":AdapterBleGattServerTest", 90 ":AdapterBtCommonTest", 91 "broadcast:unittest", 92 ] 93 } 94 } 95} 96