1# Copyright (c) 2024 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 20if (!defined(ohos_lite)) { 21 module_output_path = "dsoftbus/adapter" 22 bc_gatt_test_sources = [ 23 "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/adapter/ble/src/softbus_ble_gatt.c", 24 "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/adapter/ble/src/softbus_ble_utils.c", 25 "bluetooth_mock.cpp", 26 ] 27 28 bc_gatt_test_inc = 29 [ "${dsoftbus_root_path}/adapter/common/net/bluetooth/include" ] 30 bc_gatt_test_inc += adapter_ble_inc 31 32 bc_gatt_test_deps = [ 33 "$dsoftbus_dfx_path:softbus_dfx", 34 "$dsoftbus_root_path/core/common:softbus_utils", 35 ] 36 37 bc_gatt_test_external_deps = [ 38 "c_utils:utils", 39 "googletest:gmock_main", 40 "googletest:gtest_main", 41 "hilog:libhilog", 42 ] 43 44 if (dsoftbus_feature_deps_bluetooth && 45 (dsoftbus_feature_conn_ble || dsoftbus_feature_conn_br)) { 46 bc_gatt_test_external_deps += [ "bluetooth:btframework" ] 47 } 48 49 ohos_unittest("SoftbusBleGattTest") { 50 module_out_path = module_output_path 51 sources = bc_gatt_test_sources 52 sources += [ "softbus_ble_gatt_test.cpp" ] 53 54 include_dirs = bc_gatt_test_inc 55 deps = bc_gatt_test_deps 56 external_deps = bc_gatt_test_external_deps 57 } 58 59 ohos_unittest("SoftbusBleUtilsTest") { 60 module_out_path = module_output_path 61 sources = bc_gatt_test_sources 62 sources += [ "softbus_ble_utils_test.cpp" ] 63 64 include_dirs = bc_gatt_test_inc 65 deps = bc_gatt_test_deps 66 external_deps = bc_gatt_test_external_deps 67 } 68 69 group("unittest") { 70 testonly = true 71 deps = [] 72 if (dsoftbus_feature_deps_bluetooth && 73 (dsoftbus_feature_conn_ble || dsoftbus_feature_conn_br)) { 74 deps += [ 75 ":SoftbusBleGattTest", 76 ":SoftbusBleUtilsTest", 77 ] 78 } 79 } 80} 81