• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/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  ]
34
35  bt_test_external_deps = [
36    "c_utils:utils",
37    "googletest:gmock_main",
38    "googletest:gtest_main",
39    "hilog:libhilog",
40  ]
41
42  if (support_bluetooth &&
43      (dsoftbus_feature_conn_ble || dsoftbus_feature_conn_br)) {
44    bt_test_external_deps += [ "bluetooth:btframework" ]
45  }
46
47  ohos_unittest("AdapterBleGattServerTest") {
48    module_out_path = module_output_path
49    sources = bt_test_sources
50    sources += [ "softbus_adapter_ble_gatt_server_test.cpp" ]
51
52    include_dirs = bt_test_inc
53    deps = bt_test_deps
54    external_deps = bt_test_external_deps
55  }
56
57  ohos_unittest("AdapterBleGattClientTest") {
58    module_out_path = module_output_path
59    sources = bt_test_sources
60    sources += [ "softbus_adapter_ble_gatt_client_test.cpp" ]
61
62    include_dirs = bt_test_inc
63    deps = bt_test_deps
64    external_deps = bt_test_external_deps
65  }
66
67  ohos_unittest("AdapterBtCommonTest") {
68    module_out_path = module_output_path
69    sources = bt_test_sources
70    sources += [ "softbus_adapter_bt_common_test.cpp" ]
71
72    include_dirs = bt_test_inc
73    deps = bt_test_deps
74    external_deps = bt_test_external_deps
75  }
76
77  group("unittest") {
78    testonly = true
79    deps = []
80    if (support_bluetooth &&
81        (dsoftbus_feature_conn_ble || dsoftbus_feature_conn_br)) {
82      deps += [
83        ":AdapterBleGattClientTest",
84        ":AdapterBleGattServerTest",
85        ":AdapterBtCommonTest",
86        "broadcast:unittest",
87      ]
88    }
89  }
90}
91