• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2021 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/test.gni")
15import("//foundation/communication/bluetooth_service/bluetooth.gni")
16
17module_output_path = "bluetooth_service/bluetooth_service"
18SUBSYSTEM_DIR = "//foundation/communication"
19
20###############################################################################
21#1. intent(c++) get/set test without transport
22
23config("module_private_config") {
24  visibility = [ ":*" ]
25  cflags = []
26  if (target_cpu == "arm") {
27    cflags += [ "-DBINDER_IPC_32BIT" ]
28  }
29  include_dirs = [
30    "mock/include",
31  ]
32  defines = [
33    "BTFW_LOG_TAG = \"bluetooth_test\"",
34    "BTFW_LOG_DOMAIN = 0xD000103",
35  ]
36}
37
38ohos_unittest("btfw_hfp_ag_unit_test") {
39  module_out_path = module_output_path
40
41  sources = [ "hfp_ag_test.cpp" ]
42
43  configs = [ ":module_private_config" ]
44
45  deps = []
46
47  external_deps = [
48    "bluetooth:btframework",
49    "c_utils:utils",
50    "hilog:libhilog",
51    "ipc:ipc_core",
52    "resource_management:global_resmgr",
53    "googletest:gmock_main",
54    "googletest:gtest_main",
55  ]
56}
57
58ohos_unittest("btfw_hfp_hf_unit_test") {
59  module_out_path = module_output_path
60
61  sources = [ "hfp_hf_test.cpp" ]
62
63  configs = [ ":module_private_config" ]
64
65  deps = []
66
67  external_deps = [
68    "bluetooth:btframework",
69    "c_utils:utils",
70    "hilog:libhilog",
71    "ipc:ipc_core",
72    "resource_management:global_resmgr",
73    "googletest:gmock_main",
74    "googletest:gtest_main",
75  ]
76}
77
78ohos_unittest("btfw_hf_call_unit_test") {
79  module_out_path = module_output_path
80
81  sources = [ "hf_call_test.cpp" ]
82
83  configs = [ ":module_private_config" ]
84
85  deps = [
86    "$SUBSYSTEM_DIR/bluetooth_service/services/bluetooth/server:bluetooth_server",
87  ]
88
89  external_deps = [
90    "bluetooth:btframework",
91    "c_utils:utils",
92    "hilog:libhilog",
93    "ipc:ipc_core",
94    "resource_management:global_resmgr",
95    "googletest:gmock_main",
96    "googletest:gtest_main",
97  ]
98}
99
100################################################################################
101group("unittest") {
102  testonly = true
103
104  deps = []
105
106  if (is_phone_product) {
107    deps += [ ":btfw_hf_call_unit_test" ]
108
109    if (bluetooth_service_hfp_ag_feature) {
110      deps += [ ":btfw_hfp_ag_unit_test" ]
111    }
112
113    if (bluetooth_service_hfp_hf_feature) {
114      deps += [ ":btfw_hfp_hf_unit_test" ]
115    }
116  }
117}
118