• 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
20if (!defined(ohos_lite)) {
21  module_output_path = "dsoftbus/adapter"
22  bt_test_sources = [ "bluetooth_mock.cpp" ]
23  bt_test_sources += adapter_ble_src
24
25  bt_test_inc = [ "../../../adapter/common/net/bluetooth/include" ]
26  bt_test_inc += adapter_ble_inc
27
28  bt_test_deps = [
29    "$dsoftbus_root_path/core/common:softbus_utils",
30    "//third_party/googletest:gmock_main",
31    "//third_party/googletest:gtest_main",
32  ]
33
34  bt_test_external_deps = [
35    "c_utils:utils",
36    "hilog:libhilog",
37  ]
38
39  if (support_bluetooth &&
40      (dsoftbus_feature_conn_ble || dsoftbus_feature_conn_br)) {
41    bt_test_external_deps += [ "bluetooth:btframework" ]
42  }
43
44  ohos_unittest("AdapterBleGattTest") {
45    module_out_path = module_output_path
46    sources = bt_test_sources
47    sources += [ "softbus_adapter_ble_gatt_test.cpp" ]
48
49    include_dirs = bt_test_inc
50    deps = bt_test_deps
51    external_deps = bt_test_external_deps
52  }
53
54  ohos_unittest("AdapterBleGattServerTest") {
55    module_out_path = module_output_path
56    sources = bt_test_sources
57    sources += [ "softbus_adapter_ble_gatt_server_test.cpp" ]
58
59    include_dirs = bt_test_inc
60    deps = bt_test_deps
61    external_deps = bt_test_external_deps
62  }
63
64  ohos_unittest("AdapterBleGattClientTest") {
65    module_out_path = module_output_path
66    sources = bt_test_sources
67    sources += [ "softbus_adapter_ble_gatt_client_test.cpp" ]
68
69    include_dirs = bt_test_inc
70    deps = bt_test_deps
71    external_deps = bt_test_external_deps
72  }
73
74  ohos_unittest("AdapterBtUtilsTest") {
75    module_out_path = module_output_path
76    sources = [ "adapter_bt_utils_test.cpp" ]
77    sources += adapter_ble_src
78
79    include_dirs = bt_test_inc
80    deps = bt_test_deps
81    external_deps = bt_test_external_deps
82  }
83
84  ohos_unittest("AdapterBtCommonTest") {
85    module_out_path = module_output_path
86    sources = bt_test_sources
87    sources += [ "softbus_adapter_bt_common_test.cpp" ]
88
89    include_dirs = bt_test_inc
90    deps = bt_test_deps
91    external_deps = bt_test_external_deps
92  }
93
94  group("unittest") {
95    testonly = true
96    deps = []
97    if (support_bluetooth &&
98        (dsoftbus_feature_conn_ble || dsoftbus_feature_conn_br)) {
99      deps += [
100        ":AdapterBleGattClientTest",
101        ":AdapterBleGattServerTest",
102        ":AdapterBleGattTest",
103        ":AdapterBtCommonTest",
104        ":AdapterBtUtilsTest",
105      ]
106    }
107  }
108}
109