• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/soft_bus/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    "$dsoftbus_root_path/adapter:softbus_adapter",
36  ]
37
38  bc_gatt_test_external_deps = [
39    "c_utils:utils",
40    "googletest:gmock_main",
41    "googletest:gtest_main",
42    "hilog:libhilog",
43  ]
44
45  if (dsoftbus_feature_deps_bluetooth &&
46      (dsoftbus_feature_conn_ble || dsoftbus_feature_conn_br)) {
47    bc_gatt_test_external_deps += [ "bluetooth:btframework" ]
48  }
49
50  ohos_unittest("SoftbusBleGattTest") {
51    module_out_path = module_output_path
52    sources = bc_gatt_test_sources
53    sources += [ "softbus_ble_gatt_test.cpp" ]
54
55    include_dirs = bc_gatt_test_inc
56    deps = bc_gatt_test_deps
57    external_deps = bc_gatt_test_external_deps
58  }
59
60  ohos_unittest("SoftbusBleUtilsTest") {
61    module_out_path = module_output_path
62    sources = bc_gatt_test_sources
63    sources += [ "softbus_ble_utils_test.cpp" ]
64
65    include_dirs = bc_gatt_test_inc
66    deps = bc_gatt_test_deps
67    external_deps = bc_gatt_test_external_deps
68    external_deps += [
69      "bounds_checking_function:libsec_static",
70    ]
71  }
72
73  group("unittest") {
74    testonly = true
75    deps = []
76    if (dsoftbus_feature_deps_bluetooth &&
77        (dsoftbus_feature_conn_ble || dsoftbus_feature_conn_br)) {
78      deps += [
79        ":SoftbusBleGattTest",
80        ":SoftbusBleUtilsTest",
81      ]
82    }
83  }
84}
85